Skip to content

Commit

Permalink
Merge branch 'main' into bump_gh_actions
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/documentation.yml
#	.github/workflows/lint.yml
#	.github/workflows/unit_tests.yml
  • Loading branch information
AA-Turner committed Jul 30, 2024
2 parents 87bd327 + 0b2c40a commit 744f7e3
Show file tree
Hide file tree
Showing 31 changed files with 830 additions and 218 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
12 changes: 4 additions & 8 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@ jobs:

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

- name: set up python
uses: actions/setup-python@v4
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
16 changes: 5 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ jobs:

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

- name: set up python
uses: actions/setup-python@v4
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
45 changes: 13 additions & 32 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,31 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
sphinx-version:
- '4.0.3'
- '4.1.2'
- '4.2.0'
- '4.3.2'
- '4.5.0'
- '5.0.2'
- '5.1.1'
- '5.2.3'
- '5.3.0'
- '6.1.3'
- git+https://github.com/sphinx-doc/sphinx.git@master
exclude:
# avoid bug in following configurations
# sphinx/util/typing.py:37: in <module>
# from types import Union as types_Union
# ImportError: cannot import name 'Union' from 'types'
- python-version: '3.10'
sphinx-version: '4.0.3'
- python-version: '3.10'
sphinx-version: '4.1.2'

# Sphinx has removed support for Python 3.7, Breathe will follow.
- python-version: '3.7'
sphinx-version: git+https://github.com/sphinx-doc/sphinx.git@master
- python-version: '3.7'
sphinx-version: '6.1.3'

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

- name: install dependencies
run: |
pip install ".[test]"
- name: install sphinx from PyPI or from git
run: |
Expand All @@ -56,9 +41,5 @@ jobs:
pip install -Iv Sphinx==${{ matrix.sphinx-version }}
fi
- name: install dependencies
run: |
pip install -r requirements/development.txt
- name: run the unit tests
run: make dev-test
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.8+, Sphinx 5.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 744f7e3

Please sign in to comment.