Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support members in a Doxygen 1.9.7 group #934

Draft
wants to merge 69 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
cf63cec
Fix mistake in spelling of inheritance
michaeljones May 13, 2023
15a0fe9
Support member references in compound
JasperCraeghs Jun 19, 2023
d7160fe
Store member nodes
JasperCraeghs Jun 20, 2023
6ef8cf0
Support member references in compound
JasperCraeghs Jun 21, 2023
d0fea4b
Remove unused import 'pprint'
JasperCraeghs Jun 28, 2023
42d731b
Merge pull request #914 from breathe-doc/inheritance
michaeljones Aug 22, 2023
542ae9b
Add github sponsorships to funding config
michaeljones Oct 24, 2023
d746a4b
Support member references in compound
JasperCraeghs Jun 19, 2023
2a9ed6b
Store member nodes
JasperCraeghs Jun 20, 2023
b1de593
Support member references in compound
JasperCraeghs Jun 21, 2023
b6359af
Remove unused import 'pprint'
JasperCraeghs Jun 28, 2023
ce5f503
Merge branch 'memberdef-in-groups' of github.com:JasperCraeghs/breath…
JasperCraeghs Oct 30, 2023
06f37d8
Revert bad changes
JasperCraeghs Oct 30, 2023
86b06e9
Revert unneeded change
JasperCraeghs Oct 30, 2023
4d89014
Minor refactoring to make diff in PR smaller
JasperCraeghs Oct 30, 2023
3498158
Use a matrix to test Doxygen 1.9.7
JasperCraeghs Oct 30, 2023
20f9a22
Always read in the xml file referenced by the compound
JasperCraeghs Nov 1, 2023
5b23a92
Test doxygenfunction directive with function in group
JasperCraeghs Nov 1, 2023
1247172
Began incorporating C parser
Rouslan Nov 16, 2023
3d05263
Made progress on new parser integration
Rouslan Nov 17, 2023
7e1a87a
Replaced many references to old classes
Rouslan Nov 21, 2023
4122200
Getting close to working again
Rouslan Nov 25, 2023
eee9d22
Appears to be working now
Rouslan Nov 26, 2023
58aadd4
Replaced filter objects with plain functions
Rouslan Nov 29, 2023
8b11b89
Fixed the filters
Rouslan Dec 1, 2023
a670b76
Small fixes and new tests
Rouslan Dec 5, 2023
997e1a8
More tests and another fix
Rouslan Dec 5, 2023
7163482
more tests, more fixes
Rouslan Dec 6, 2023
23cdf28
A few more fixes; a bunch more tests
Rouslan Dec 10, 2023
918525e
Another little fix
Rouslan Dec 11, 2023
ec4010e
Uncoupled test and example code and more tests
Rouslan Dec 12, 2023
4323b9c
Formatted with Black and added test
Rouslan Dec 13, 2023
5f55b64
Update unit test action
Rouslan Dec 13, 2023
5626a08
Update git actions - attempt 2
Rouslan Dec 13, 2023
cec80a6
Attempted fix for code that works locally but not on test runner
Rouslan Dec 13, 2023
6583436
Fix in Github actions and Python compatibility
Rouslan Dec 13, 2023
d64b641
Fixed problem introduced by previous fix
Rouslan Dec 13, 2023
42f9e11
Neglected to install Doxygen in unit test action
Rouslan Dec 13, 2023
9c20dc7
Updated Github actions and added much needed cache
Rouslan Dec 13, 2023
d7f7746
Better caching
Rouslan Dec 13, 2023
2f27528
Fixed mistake in actions
Rouslan Dec 13, 2023
cdb8564
Another attempt at Github actions
Rouslan Dec 13, 2023
7f48ddb
Made tests compatible with older packages and Doxygen versions
Rouslan Dec 15, 2023
925f1a1
Compatibility fixes
Rouslan Dec 15, 2023
a6e1135
A fix, new tests and linter/typing conformance
Rouslan Dec 15, 2023
771ca62
One small fix
Rouslan Dec 15, 2023
fd22f6b
Remove unused import
JasperCraeghs Dec 20, 2023
86815a9
Reorganized setup code and metadata
Rouslan Dec 20, 2023
9323b9f
Style fix
JasperCraeghs Dec 21, 2023
4071ffc
Check type of object to prevent AttributeError
JasperCraeghs Dec 21, 2023
5c3b6fb
Don't warn about duplicate memberdef with the same signature
JasperCraeghs Dec 21, 2023
5f5f7ce
Prevent IndexError when no result was found due to arg spec
JasperCraeghs Dec 22, 2023
8568960
Refactored "finders", eliminating huge bottleneck
Rouslan Dec 24, 2023
94d5f00
Parser now converts html entity tags
Rouslan Dec 26, 2023
fb2fd79
Minor fix and added new doc-strings
Rouslan Dec 26, 2023
becb3a5
Tweaked setup options and added internal documentation
Rouslan Dec 28, 2023
f70f22e
Added ability to run tests with "cached" Doxygen output
Rouslan Jan 8, 2024
a580332
Now generates pure-python parser in addition to compiled extension
Rouslan Jan 13, 2024
d479834
Removed compiled version of parser
Rouslan Jan 14, 2024
1659373
Fixed working with multiple "projects"
Rouslan Jan 22, 2024
fab44ad
Now compatible with in-development sphinx version 7.3
Rouslan Jan 22, 2024
c8fb596
Updated makefile and version check script
Rouslan Jan 23, 2024
5465c9d
fixed/silenced mypy errors
Rouslan Jan 23, 2024
db2ae32
Merge branch 'main' of https://github.com/Rouslan/breathe into member…
Rouslan Feb 10, 2024
5113947
Added Doxygen 1.9.7 to unit test action matrix
Rouslan Feb 10, 2024
01c61cd
Fixed minor lint error
Rouslan Feb 10, 2024
65f2ee1
Fixed mistake in actions
Rouslan Feb 10, 2024
26cce59
Another Github action fix
Rouslan Feb 10, 2024
ed05afd
Merge pull request #1 from Rouslan/memberdef-in-groups
Rouslan Feb 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
33 changes: 33 additions & 0 deletions .github/workflows/cache_doxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: download and cache Doxygen
on:
workflow_call
jobs:
install:
runs-on: ubuntu-latest
concurrency:
group: linux-doxygen-${{ matrix.doxygen-version }}-cache
strategy:
fail-fast: false
matrix:
doxygen-version: ['1.9.4', '1.9.7']
steps:
- uses: actions/cache/restore@v4
id: cache-doxygen
with:
path: doxygen-bin-arc
key: ${{ runner.os }}-doxygen-${{ matrix.doxygen-version }}
lookup-only: true
restore-keys: |
${{ runner.os }}-doxygen-

- name: download Doxygen from SF binary archives
if: steps.cache-doxygen.outputs.cache-hit != 'true'
run: |
mkdir doxygen-bin-arc && cd doxygen-bin-arc
curl -L https://sourceforge.net/projects/doxygen/files/rel-${{ matrix.doxygen-version }}/doxygen-${{ matrix.doxygen-version }}.linux.bin.tar.gz > doxygen.tar.gz

- uses: actions/cache/save@v4
if: steps.cache-doxygen.outputs.cache-hit != 'true'
with:
path: doxygen-bin-arc
key: ${{ steps.cache-doxygen.outputs.cache-primary-key }}
46 changes: 27 additions & 19 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,53 @@
name: build the documentation
on: [push, pull_request]
env:
DOXYGEN_VERSION: 1.9.4
jobs:
build:
cache-doxygen:
uses: ./.github/workflows/cache_doxygen.yml

build:
needs: cache-doxygen
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@v4
with:
cache: 'pip'
cache-dependency-path: |
requirements/development.txt
requirements/production.txt

- name: install dependencies
- name: install dependencies and build extension module
run: |
pip install -r requirements/development.txt
sudo apt-get -y update
sudo apt-get -y install graphviz libclang1-11 libclang-cpp11
pip install -r requirements/development.txt
pip install --editable .

- name: install doxygen from SF binary archives
env:
DOXYGEN_VERSION: 1.9.4
- uses: actions/cache/restore@v4
id: cache-doxygen
with:
path: doxygen-bin-arc
fail-on-cache-miss: true
key: ${{ runner.os }}-doxygen-${{ env.DOXYGEN_VERSION }}

- name: install Doxygen
run: |
mkdir doxygen-bin-arc && cd doxygen-bin-arc
curl -L https://sourceforge.net/projects/doxygen/files/rel-$DOXYGEN_VERSION/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz > doxygen.tar.gz
cd doxygen-bin-arc
gunzip doxygen.tar.gz
tar xf doxygen.tar
cd doxygen-$DOXYGEN_VERSION
cd doxygen-${{ env.DOXYGEN_VERSION }}
sudo make install

- name: build the documentation
run: |
make html
rm documentation/build/html/.buildinfo

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: docs build artifacts
path: |
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ jobs:

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-
- name: set up python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
cache: 'pip'
cache-dependency-path: |
requirements/development.txt
requirements/production.txt

- name: install dependencies
run: |
Expand Down
58 changes: 40 additions & 18 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: unit tests
on: [push, pull_request]
jobs:
build:
cache-doxygen:
uses: ./.github/workflows/cache_doxygen.yml

build:
needs: cache-doxygen
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
doxygen-version: ['1.9.4', '1.9.7']
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'
Expand All @@ -20,6 +22,10 @@ jobs:
- '6.1.3'
- git+https://github.com/sphinx-doc/sphinx.git@master
exclude:
# the git version isn't compatible with Python 3.8
- python-version: '3.8'
sphinx-version: git+https://github.com/sphinx-doc/sphinx.git@master

# avoid bug in following configurations
# sphinx/util/typing.py:37: in <module>
# from types import Union as types_Union
Expand All @@ -28,25 +34,25 @@ jobs:
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'
- python-version: '3.11'
sphinx-version: '4.0.3'
- python-version: '3.11'
sphinx-version: '4.1.2'
- python-version: '3.12'
sphinx-version: '4.0.3'
- python-version: '3.12'
sphinx-version: '4.1.2'

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-
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
requirements/development.txt
requirements/production.txt

- name: install sphinx from PyPI or from git
run: |
Expand All @@ -56,9 +62,25 @@ jobs:
pip install -Iv Sphinx==${{ matrix.sphinx-version }}
fi

- name: install dependencies
- uses: actions/cache/restore@v4
id: cache-doxygen
with:
path: doxygen-bin-arc
fail-on-cache-miss: true
key: ${{ runner.os }}-doxygen-${{ matrix.doxygen-version }}

- name: install Doxygen
run: |
cd doxygen-bin-arc
gunzip doxygen.tar.gz
tar xf doxygen.tar
cd doxygen-${{ matrix.doxygen-version }}
sudo make install

- name: install dependencies and build extension module
run: |
pip install -r requirements/development.txt
pip install --editable .

- name: run the unit tests
run: make dev-test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ com_crashlytics_export_strings.xml
# modified by build process
examples/doxygen/example.tag
examples/specific/dot_graphs/xml/dotfile.dot

# generated in editable install
/breathe/_parser.py
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
recursive-include xml_parser_generator *.py *.in *.json
include requirements/*.txt tests/*.py
graft tests/data
exclude breathe/_parser.py
global-exclude *.py[cod]
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
RM = rm -f
GENERATED_MOD = breathe/_parser.py

.PHONY: all
all: html pdf
Expand All @@ -16,9 +18,16 @@ data:
$(MAKE) -C examples/tinyxml all
$(MAKE) -C examples/specific all

$(GENERATED_MOD): \
xml_parser_generator/schema.json \
xml_parser_generator/module_template.py.in \
xml_parser_generator/make_parser.py
python3 xml_parser_generator/setuptools_builder.py

.PHONY: distclean
distclean: clean
$(MAKE) -C documentation clean
$(RM) $(GENERATED_MOD)

.PHONY: clean
clean:
Expand All @@ -31,7 +40,7 @@ test:
cd tests && python3 -m pytest -v

.PHONY: dev-test
dev-test:
dev-test: $(GENERATED_MOD)
cd tests && PYTHONPATH=../:$(PYTHONPATH) python3 -m pytest -v

.PHONY: flake8
Expand All @@ -43,7 +52,7 @@ black:
black --check .

.PHONY: type-check
type-check:
type-check: $(GENERATED_MOD)
mypy --warn-redundant-casts --warn-unused-ignores breathe tests

.PHONY: version-check
Expand Down
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 4.0+ and Doxygen 1.8+.

Mailing List Archives
---------------------
Expand Down
6 changes: 3 additions & 3 deletions breathe/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ breathe

- **directive** - Contains some rst directive definitions. These were split out
of `directives.py` when it started to become too large.
- **parser** - Contains code for parsing the doxygen xml into a tree of Python
objects. The vast majority of the code is autogenerated but there are now
small but significant tweaks which means we don't regenerate it.
- **finder** - Provides classes for finding nodes within the set of xml
files generated by doxygen. Finders are generally used in the `run` methods of
the directives to find the xml node which is then passed to the renderer to
Expand All @@ -23,6 +20,9 @@ breathe
- **directives** - Contains the definitions of some of the directives. The rest
are in the files in the `directive` folder. It also contains all the set up
code which registers with Sphinx and wires together all the various factories.
- **parser** - Contains code for parsing the doxygen xml into a tree of Python
objects. Most of its content is imported from `_parser`, which is generated
automatically when Breathe is built.
- **process** - Contains the code responsible for running the `doxygen` process
when using the `autodoxygen` directives.
- **project** - Handles the concept of a `Project` which is the breathe term for
Expand Down
10 changes: 5 additions & 5 deletions breathe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from breathe.directives.setup import setup as directive_setup
from breathe.file_state_cache import setup as file_state_cache_setup
from breathe.renderer.sphinxrenderer import setup as renderer_setup

from sphinx.application import Sphinx

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


def setup(app: Sphinx):
from breathe.directives.setup import setup as directive_setup
from breathe.file_state_cache import setup as file_state_cache_setup
from breathe.renderer.sphinxrenderer import setup as renderer_setup

directive_setup(app)
file_state_cache_setup(app)
renderer_setup(app)
Expand Down
15 changes: 4 additions & 11 deletions breathe/apidoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,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
import argparse
Expand All @@ -24,13 +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
Expand Down Expand Up @@ -76,9 +67,10 @@ def write_file(name, text, args):
if orig == text:
print_info("File %s up to date, skipping." % fname, args)
return
except FileNotFoundError:
except OSError as exc:
# Don't mind if it isn't there
pass
if exc.errno != errno.ENOENT:
raise

with open(fname, "w") as target:
target.write(text)
Expand Down Expand Up @@ -146,6 +138,7 @@ def __init__(self, option_strings, dest, **kwargs):
self.metavar = ",".join(TYPEDICT.keys())

def __call__(self, parser, namespace, values, option_string=None):
assert isinstance(values, str)
value_list = values.split(",")
for value in value_list:
if value not in TYPEDICT:
Expand Down
Loading