Skip to content

Commit

Permalink
Merge branch 'main' into fix_gh_actions
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/unit_tests.yml
  • Loading branch information
AA-Turner committed Jul 30, 2024
2 parents a76658e + 75de36f commit 4393f30
Show file tree
Hide file tree
Showing 31 changed files with 824 additions and 197 deletions.
6 changes: 0 additions & 6 deletions setup.cfg → .flake8
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[metadata]
license_file = LICENSE

[flake8]
max-line-length = 100
exclude = compoundsuper.py,indexsuper.py
extend-ignore = E203, E231
per-file-ignores =
breathe/parser/index.py:E305

[bdist_wheel]
universal = 0
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: breathe-doc
patreon: # Replace with a single Patreon username
open_collective: breathe
ko_fi: # Replace with a single Ko-fi username
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v4

- name: set up python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
cache: 'pip'

- name: install dependencies
run: |
pip install -r requirements/development.txt
pip install ".[docs]"
sudo apt-get -y update
sudo apt-get -y install graphviz libclang1-11 libclang-cpp11
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v4

- name: set up python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
cache: 'pip'

- name: install dependencies
run: |
pip install -r requirements/development.txt
pip install ".[lint]"
- name: lint the source code
run: make flake8
Expand All @@ -28,6 +25,3 @@ jobs:

- name: type check the source code
run: make type-check

- name: check version numbers are in sync
run: make version-check
13 changes: 4 additions & 9 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,16 @@ jobs:
sphinx-version: '6.1.3'

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: install dependencies
run: |
pip install -r requirements/development.txt
pip install ".[test]"
- name: install sphinx from PyPI or from git
run: |
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,3 @@ black:
.PHONY: type-check
type-check:
mypy --warn-redundant-casts --warn-unused-ignores breathe tests

.PHONY: version-check
version-check:
PYTHONPATH=../:$(PYTHONPATH) python3 scripts/version-check.py
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ branch.
Requirements
------------

Breathe requires Python 3.6+, Sphinx 4.0+ and Doxygen 1.8+.
Breathe requires Python 3.7+, Sphinx 4.0+ and Doxygen 1.8+.

Mailing List Archives
---------------------
Expand Down
1 change: 0 additions & 1 deletion breathe-apidoc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

Expand Down
1 change: 0 additions & 1 deletion breathe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from sphinx.application import Sphinx

# Keep in sync with setup.py __version__
__version__ = "4.35.0"


Expand Down
14 changes: 2 additions & 12 deletions breathe/apidoc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
breathe.apidoc
~~~~~~~~~~~~~~
Expand All @@ -14,7 +13,6 @@
:copyright: Originally by Sphinx Team, C++ modifications by Tatsuyuki Ishi
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function

import os
import sys
Expand All @@ -24,14 +22,6 @@

from breathe import __version__

# Account for FileNotFoundError in Python 2
# IOError is broader but will hopefully suffice
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError


# Reference: Doxygen XSD schema file, CompoundKind only
# Only what breathe supports are included
# Translates identifier to English
Expand Down Expand Up @@ -71,7 +61,7 @@ def write_file(name, text, args):
if exc.errno != errno.EEXIST:
raise
try:
with open(fname, "r") as target:
with open(fname) as target:
orig = target.read()
if orig == text:
print_info("File %s up to date, skipping." % fname, args)
Expand Down Expand Up @@ -141,7 +131,7 @@ def recurse_tree(args):

class TypeAction(argparse.Action):
def __init__(self, option_strings, dest, **kwargs):
super(TypeAction, self).__init__(option_strings, dest, **kwargs)
super().__init__(option_strings, dest, **kwargs)
self.default = TYPEDICT.keys()
self.metavar = ",".join(TYPEDICT.keys())

Expand Down
4 changes: 2 additions & 2 deletions breathe/parser/compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def __init__(self, char=None, valueOf_=''):
# end class docCharTypeSub


class verbatimTypeSub(object):
class verbatimTypeSub:
"""
New node type. Structure is largely pillaged from other nodes in order to
match the set.
Expand Down Expand Up @@ -1200,7 +1200,7 @@ def parse(inFilename):

try:
doc = minidom.parse(inFilename)
except IOError as e:
except OSError as e:
raise FileIOError(e)
except ExpatError as e:
raise ParseError(e)
Expand Down
4 changes: 2 additions & 2 deletions breathe/parser/compoundsuper.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def getName(self):
return self.name


class _MemberSpec(object):
class _MemberSpec:
def __init__(self, name='', data_type='', container=0):
self.name = name
self.data_type = data_type
Expand Down Expand Up @@ -2632,7 +2632,7 @@ def buildChildren(self, child_, nodeName_):
value_.append(text_.nodeValue)
# We make this unicode so that our unicode renderer catch-all picks it up
# otherwise it would go through as 'str' and we'd have to pick it up too
valuestr_ = u' '
valuestr_ = ' '
obj_ = self.mixedclass_(MixedContainer.CategorySimple,
MixedContainer.TypeString, 'sp', valuestr_)
self.content_.append(obj_)
Expand Down
2 changes: 1 addition & 1 deletion breathe/parser/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class FileIOError(Exception):
def parse(inFilename):
try:
doc = minidom.parse(inFilename)
except IOError as e:
except OSError as e:
raise FileIOError(e)
except ExpatError as e:
raise ParseError(e)
Expand Down
2 changes: 1 addition & 1 deletion breathe/parser/indexsuper.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def getName(self):
return self.name


class _MemberSpec(object):
class _MemberSpec:
def __init__(self, name='', data_type='', container=0):
self.name = name
self.data_type = data_type
Expand Down
5 changes: 2 additions & 3 deletions breathe/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,9 @@ def __init__(self, app: Sphinx):
self.app = app
# note: don't access self.app.config now, as we are instantiated at setup-time.

# Assume general build directory is the doctree directory without the last component.
# We strip off any trailing slashes so that dirname correctly drops the last part.
# Assume general build directory is the parent of the doctree directory.
# This can be overridden with the breathe_build_directory config variable
self._default_build_dir = os.path.dirname(app.doctreedir.rstrip(os.sep))
self._default_build_dir = os.path.dirname(os.path.normpath(app.doctreedir))
self.project_count = 0
self.project_info_store: Dict[str, ProjectInfo] = {}
self.project_info_for_auto_store: Dict[str, AutoProjectInfo] = {}
Expand Down
9 changes: 3 additions & 6 deletions breathe/renderer/sphinxrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2402,12 +2402,9 @@ def visit_docdotfile(self, node) -> List[Node]:
# Use self.project_info.project_path as the XML_OUTPUT path, and
# make it absolute with consideration to the conf.py path
project_path = self.project_info.project_path()
if os.path.isabs(project_path):
dot_file_path = os.path.abspath(project_path + os.sep + dot_file_path)
else:
dot_file_path = os.path.abspath(
self.app.confdir + os.sep + project_path + os.sep + dot_file_path
)
dot_file_path = os.path.abspath(
os.path.join(self.app.confdir, project_path, dot_file_path)
)
try:
with open(dot_file_path, encoding="utf-8") as fp:
dotcode = fp.read()
Expand Down
2 changes: 1 addition & 1 deletion documentation/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ dependencies:
- doxygen
- pip
- pip:
- -r ../requirements/development.txt
- ".[docs,lint,test]"
Loading

0 comments on commit 4393f30

Please sign in to comment.