diff -Nru breathe-4.33.1/breathe/directives/class_like.py breathe-4.34.0/breathe/directives/class_like.py --- breathe-4.33.1/breathe/directives/class_like.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/breathe/directives/class_like.py 2022-06-20 18:46:49.000000000 +0000 @@ -5,7 +5,7 @@ from breathe.renderer.target import create_target_handler from docutils.nodes import Node -from docutils.parsers.rst.directives import unchanged_required, unchanged, flag # type: ignore +from docutils.parsers.rst.directives import unchanged_required, unchanged, flag from typing import Any, List diff -Nru breathe-4.33.1/breathe/directives/content_block.py breathe-4.34.0/breathe/directives/content_block.py --- breathe-4.33.1/breathe/directives/content_block.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/breathe/directives/content_block.py 2022-06-20 18:46:49.000000000 +0000 @@ -7,7 +7,7 @@ from breathe.renderer.target import create_target_handler from docutils.nodes import Node -from docutils.parsers.rst.directives import unchanged_required, flag # type: ignore +from docutils.parsers.rst.directives import unchanged_required, flag from typing import Any, List diff -Nru breathe-4.33.1/breathe/directives/file.py breathe-4.34.0/breathe/directives/file.py --- breathe-4.33.1/breathe/directives/file.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/breathe/directives/file.py 2022-06-20 18:46:49.000000000 +0000 @@ -6,7 +6,7 @@ from breathe.renderer.sphinxrenderer import SphinxRenderer from breathe.renderer.target import create_target_handler -from docutils.parsers.rst.directives import unchanged_required, flag # type: ignore +from docutils.parsers.rst.directives import unchanged_required, flag class _BaseFileDirective(BaseDirective): diff -Nru breathe-4.33.1/breathe/directives/function.py breathe-4.34.0/breathe/directives/function.py --- breathe-4.33.1/breathe/directives/function.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/breathe/directives/function.py 2022-06-20 18:46:49.000000000 +0000 @@ -10,7 +10,7 @@ from breathe.renderer.target import create_target_handler from docutils.nodes import Node -from docutils.parsers.rst.directives import unchanged_required, flag # type: ignore +from docutils.parsers.rst.directives import unchanged_required, flag from sphinx.domains import cpp diff -Nru breathe-4.33.1/breathe/directives/index.py breathe-4.34.0/breathe/directives/index.py --- breathe-4.33.1/breathe/directives/index.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/breathe/directives/index.py 2022-06-20 18:46:49.000000000 +0000 @@ -7,7 +7,7 @@ from breathe.renderer.target import create_target_handler from docutils.nodes import Node -from docutils.parsers.rst.directives import unchanged_required, flag # type: ignore +from docutils.parsers.rst.directives import unchanged_required, flag from typing import List diff -Nru breathe-4.33.1/breathe/directives/item.py breathe-4.34.0/breathe/directives/item.py --- breathe-4.33.1/breathe/directives/item.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/breathe/directives/item.py 2022-06-20 18:46:49.000000000 +0000 @@ -7,7 +7,7 @@ from docutils.nodes import Node -from docutils.parsers.rst.directives import unchanged_required, flag # type: ignore +from docutils.parsers.rst.directives import unchanged_required, flag from typing import Any, List diff -Nru breathe-4.33.1/breathe/filetypes.py breathe-4.34.0/breathe/filetypes.py --- breathe-4.33.1/breathe/filetypes.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/breathe/filetypes.py 2022-06-20 18:46:49.000000000 +0000 @@ -1,15 +1,20 @@ +""" +A module to house the methods for resolving a code-blocks language based on filename +(and extension). +""" from typing import Optional import os.path -import pygments # type: ignore +from pygments.lexers import get_lexer_for_filename +from pygments.util import ClassNotFound def get_pygments_alias(filename: str) -> Optional[str]: "Find first pygments alias from filename" try: - lexer_cls = pygments.lexers.get_lexer_for_filename(filename) - return lexer_cls.aliases[0] - except pygments.util.ClassNotFound: + lexer_cls = get_lexer_for_filename(filename) + return lexer_cls.aliases[0] # type: ignore + except ClassNotFound: return None @@ -18,4 +23,7 @@ # If the filename is just '.ext' then we get ('.ext', '') so we fall back to first part if # the second isn't there (first, second) = os.path.splitext(filename) - return (second or first).lstrip(".") + + # Doxygen allows users to specify the file extension ".unparsed" to disable syntax highlighting. + # We translate it into the pygments un-highlighted 'text' type + return (second or first).lstrip(".").replace("unparsed", "text") diff -Nru breathe-4.33.1/breathe/__init__.py breathe-4.34.0/breathe/__init__.py --- breathe-4.33.1/breathe/__init__.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/breathe/__init__.py 2022-06-20 18:46:49.000000000 +0000 @@ -5,7 +5,7 @@ from sphinx.application import Sphinx # Keep in sync with setup.py __version__ -__version__ = "4.33.1" +__version__ = "4.34.0" def setup(app: Sphinx): diff -Nru breathe-4.33.1/breathe/renderer/sphinxrenderer.py breathe-4.34.0/breathe/renderer/sphinxrenderer.py --- breathe-4.33.1/breathe/renderer/sphinxrenderer.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/breathe/renderer/sphinxrenderer.py 2022-06-20 18:46:49.000000000 +0000 @@ -1,3 +1,4 @@ +import os import sphinx from breathe.parser import compound, compoundsuper, DoxygenCompoundParser @@ -15,7 +16,7 @@ from sphinx.ext.graphviz import graphviz from docutils import nodes -from docutils.nodes import Element, Node, TextElement +from docutils.nodes import Node, TextElement from docutils.statemachine import StringList, UnexpectedIndentationError from docutils.parsers.rst.states import Text @@ -359,6 +360,12 @@ def visit_desc_content(self, node): self.content = node + # The SparseNodeVisitor seems to not actually be universally Sparse, + # but only for nodes known to Docutils. + # So if there are extensions with new node types in the content, + # then the visitation will fail. + # We anyway don't need to visit the actual content, so skip it. + raise nodes.SkipChildren def intersperse(iterable, delimiter): @@ -840,7 +847,7 @@ signode.children = [n for n in signode.children if not n.tagname == "desc_addname"] return nodes - def create_doxygen_target(self, node) -> List[Element]: + def create_doxygen_target(self, node): """Can be overridden to create a target node which uses the doxygen refid information which can be used for creating links between internal doxygen elements. @@ -990,7 +997,7 @@ return nodes def visit_doxygen(self, node) -> List[Node]: - nodelist = [] + nodelist: List[Node] = [] # Process all the compound children for n in node.get_compound(): @@ -1736,11 +1743,11 @@ return [rst_node] - def visit_inc(self, node: compoundsuper.incType) -> List[nodes.container]: + def visit_inc(self, node: compoundsuper.incType) -> List[Node]: if not self.app.config.breathe_show_include: return [] - compound_link = [nodes.Text("", node.content_[0].getValue())] + compound_link: List[Node] = [nodes.Text(node.content_[0].getValue())] if node.get_refid(): compound_link = self.visit_docreftext(node) if node.local == "yes": @@ -1748,7 +1755,7 @@ else: text = [nodes.Text("#include <"), *compound_link, nodes.Text(">")] - return [nodes.container("", nodes.emphasis("", *text))] + return [nodes.container("", nodes.emphasis("", "", *text))] def visit_ref(self, node: compoundsuper.refType) -> List[Node]: def get_node_info(file_data): @@ -1862,7 +1869,7 @@ return self.render_iterable(content) def visit_docanchor(self, node) -> List[Node]: - return self.create_doxygen_target(node) + return list(self.create_doxygen_target(node)) def visit_docentry(self, node) -> List[Node]: col = nodes.entry() @@ -2062,7 +2069,8 @@ names = self.get_qualification() names.append(node.name) declaration = self.join_nested_name(names) - if node.strong == "yes": + dom = self.get_domain() + if (not dom or dom == "cpp") and node.strong == "yes": # It looks like Doxygen does not make a difference # between 'enum class' and 'enum struct', # so render them both as 'enum class'. @@ -2196,7 +2204,7 @@ def visit_templateparam( self, node: compound.paramTypeSub, *, insertDeclNameByParsing: bool = False ) -> List[Node]: - nodelist = [] + nodelist: List[Node] = [] # Parameter type if node.type_: @@ -2363,11 +2371,26 @@ def visit_docdotfile(self, node) -> List[Node]: """Translate node from doxygen's dotfile command to sphinx's graphviz directive.""" dotcode = "" + dot_file_path = node.name # type: str + # Doxygen v1.9.3+ uses a relative path to specify the dot file. + # Previously, Doxygen used an absolute path. + # This relative path is with respect to the XML_OUTPUT path. + # Furthermore, Doxygen v1.9.3+ will copy the dot file into the XML_OUTPUT + if not os.path.isabs(dot_file_path): + # 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 + ) try: - with open(node.name, encoding="utf-8") as fp: + with open(dot_file_path, encoding="utf-8") as fp: dotcode = fp.read() if not dotcode.rstrip("\n"): - raise RuntimeError("%s found but without any content" % node.name) + raise RuntimeError("%s found but without any content" % dot_file_path) except OSError as exc: # doxygen seems to prevent this from triggering as a non-existant file # generates no XML output for the corresponding `\dotfile` cmd @@ -2376,7 +2399,7 @@ self.state.document.reporter.warning(exc) graph_node = graphviz() graph_node["code"] = dotcode - graph_node["options"] = {"docname": node.name} + graph_node["options"] = {"docname": dot_file_path} caption = "" if not node.content_ else node.content_[0].getValue() if caption: caption_node = nodes.caption(caption, "") diff -Nru breathe-4.33.1/breathe/renderer/target.py breathe-4.34.0/breathe/renderer/target.py --- breathe-4.33.1/breathe/renderer/target.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/breathe/renderer/target.py 2022-06-20 18:46:49.000000000 +0000 @@ -3,11 +3,11 @@ from docutils import nodes from docutils.nodes import Element -from typing import Any, Dict, List +from typing import Any, Dict, List, Sequence class TargetHandler: - def create_target(self, refid: str) -> List[Element]: + def create_target(self, refid: str) -> Sequence[Element]: raise NotImplementedError diff -Nru breathe-4.33.1/CHANGELOG.rst breathe-4.34.0/CHANGELOG.rst --- breathe-4.33.1/CHANGELOG.rst 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/CHANGELOG.rst 2022-06-20 18:46:49.000000000 +0000 @@ -3,6 +3,36 @@ Inspired by `Keepachangelog.com `__. +- 2022-06-20 - **Breathe v4.34.0** + + - Treat .unparsed as plain text. + `#806 `__ + - Remove unneeded type: ignore annotations. + `#813 `__ + - Fix internal ``NodeFinder`` visitor for when non-Docutils nodes are + present in the content of a directive. + `#812 `__ + - Rename lint workflow. + `#814 `__ + - Type check pygments and limit docutils stub version. + `#819 `__ + - Convert dot files' relative path to absolute. + `#821 `__ + - CI, update Sphinx versions to test. + `#834 `__ + - CI, update for Sphinx 5.0.1. + `#846 `__ + - Fix inconsistency in example. + `#843 `__ + - Fix C# enum rendering crash. + `#849 `__ + - Drop Sphinx 3 support, add Sphinx 5 support. + `#850 `__ + - CICD: Disable python 3.6 for Sphinx master tests. + `#853 `__ + - Populate default include text-node's data field instead of raw-source. + `#828 `__ + - 2022-02-14 - **Breathe v4.33.1** - Avoid warning about multiple graphviz directives. diff -Nru breathe-4.33.1/debian/changelog breathe-4.34.0/debian/changelog --- breathe-4.33.1/debian/changelog 2022-03-01 15:03:34.000000000 +0000 +++ breathe-4.34.0/debian/changelog 2022-06-21 11:05:51.000000000 +0000 @@ -1,3 +1,10 @@ +breathe (4.34.0-1) unstable; urgency=medium + + * New upstream version 4.34.0 + * Bump Standards-Version to 4.6.1 + + -- Timo Röhling Tue, 21 Jun 2022 13:05:51 +0200 + breathe (4.33.1-3) unstable; urgency=medium * Fix autopkgtest to not use Git diff -Nru breathe-4.33.1/debian/control breathe-4.34.0/debian/control --- breathe-4.33.1/debian/control 2022-02-19 08:00:03.000000000 +0000 +++ breathe-4.34.0/debian/control 2022-06-21 11:05:35.000000000 +0000 @@ -17,7 +17,7 @@ texlive-plain-generic, texlive-latex-extra, texlive-fonts-recommended -Standards-Version: 4.6.0 +Standards-Version: 4.6.1 Vcs-Git: https://salsa.debian.org/python-team/packages/breathe.git Vcs-Browser: https://salsa.debian.org/python-team/packages/breathe Homepage: https://github.com/michaeljones/breathe/ diff -Nru breathe-4.33.1/documentation/source/codeblocks.rst breathe-4.34.0/documentation/source/codeblocks.rst --- breathe-4.33.1/documentation/source/codeblocks.rst 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/documentation/source/codeblocks.rst 2022-06-20 18:46:49.000000000 +0000 @@ -91,6 +91,11 @@ * message(STATUS "Element is ${element}") * endforeach() * @endcode + * + * Another code-block that explicitly remains not highlighted. + * @code{.unparsed} + * Show this as is. + * @endcode */ void with_unannotated_cmake_code_block(); diff -Nru breathe-4.33.1/examples/doxygen/example_test.cpp breathe-4.34.0/examples/doxygen/example_test.cpp --- breathe-4.33.1/examples/doxygen/example_test.cpp 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/examples/doxygen/example_test.cpp 2022-06-20 18:46:49.000000000 +0000 @@ -1,5 +1,5 @@ void main() { - Test7 t; + Test5 t; t.example(); } diff -Nru breathe-4.33.1/examples/specific/code_blocks.h breathe-4.34.0/examples/specific/code_blocks.h --- breathe-4.33.1/examples/specific/code_blocks.h 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/examples/specific/code_blocks.h 2022-06-20 18:46:49.000000000 +0000 @@ -16,6 +16,11 @@ * message(STATUS "Element is ${element}") * endforeach() * @endcode + * + * Another code-block that explicitly remains not highlighted. + * @code{.unparsed} + * Show this as is. + * @endcode */ void with_unannotated_cmake_code_block(); diff -Nru breathe-4.33.1/.github/workflows/lint.yml breathe-4.34.0/.github/workflows/lint.yml --- breathe-4.33.1/.github/workflows/lint.yml 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/.github/workflows/lint.yml 2022-06-20 18:46:49.000000000 +0000 @@ -1,4 +1,4 @@ -name: lint using flake8 +name: lint on: [push, pull_request] jobs: build: diff -Nru breathe-4.33.1/.github/workflows/unit_tests.yml breathe-4.34.0/.github/workflows/unit_tests.yml --- breathe-4.33.1/.github/workflows/unit_tests.yml 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/.github/workflows/unit_tests.yml 2022-06-20 18:46:49.000000000 +0000 @@ -9,27 +9,24 @@ matrix: python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] sphinx-version: - - '3.0.4' - - '3.1.2' - - '3.2.1' - - '3.3.1' - - '3.4.3' - - '3.5.4' - '4.0.3' - '4.1.2' - '4.2.0' - '4.3.2' - - '4.4.0' - - git+https://github.com/sphinx-doc/sphinx.git@4.4.x - - git+https://github.com/sphinx-doc/sphinx.git@4.x + - '4.5.0' + - '5.0.1' + - git+https://github.com/sphinx-doc/sphinx.git@5.0.x + - git+https://github.com/sphinx-doc/sphinx.git@5.x - git+https://github.com/sphinx-doc/sphinx.git@master - # avoid bug in following configurations - # sphinx/util/typing.py:37: in - # from types import Union as types_Union - # ImportError: cannot import name 'Union' from 'types' exclude: - - python-version: '3.10' - sphinx-version: '3.5.4' + # Since sphinx 7e68154e49fbb260f7ffee9791bfafdb7fd2e119 python 3.6 + # support is removed. Breathe will probably also drop 3.6 soon. + - python-version: '3.6' + sphinx-version: git+https://github.com/sphinx-doc/sphinx.git@master + # avoid bug in following configurations + # sphinx/util/typing.py:37: in + # 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' diff -Nru breathe-4.33.1/.gitignore breathe-4.34.0/.gitignore --- breathe-4.33.1/.gitignore 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/.gitignore 2022-06-20 18:46:49.000000000 +0000 @@ -47,3 +47,4 @@ # modified by build process examples/doxygen/example.tag +examples/specific/dot_graphs/xml/dotfile.dot diff -Nru breathe-4.33.1/README.rst breathe-4.34.0/README.rst --- breathe-4.33.1/README.rst 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/README.rst 2022-06-20 18:46:49.000000000 +0000 @@ -98,7 +98,7 @@ Requirements ------------ -Breathe requires Python 3.6+, Sphinx 3.0+ and Doxygen 1.8+. +Breathe requires Python 3.6+, Sphinx 4.0+ and Doxygen 1.8+. Mailing List Archives --------------------- diff -Nru breathe-4.33.1/requirements/development.txt breathe-4.34.0/requirements/development.txt --- breathe-4.33.1/requirements/development.txt 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/requirements/development.txt 2022-06-20 18:46:49.000000000 +0000 @@ -5,6 +5,7 @@ pytest mypy>=0.900 -types-docutils>=0.17.0 +types-docutils>=0.14,<0.18 +types-Pygments -black==22.1.0 +black==22.3.0 diff -Nru breathe-4.33.1/requirements/production.txt breathe-4.34.0/requirements/production.txt --- breathe-4.33.1/requirements/production.txt 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/requirements/production.txt 2022-06-20 18:46:49.000000000 +0000 @@ -2,4 +2,4 @@ Jinja2>=2.7.3 MarkupSafe>=0.23 Pygments>=1.6 -Sphinx>=3.0,<5 +Sphinx>=4.0,<6,!=5.0.0 diff -Nru breathe-4.33.1/setup.py breathe-4.34.0/setup.py --- breathe-4.33.1/setup.py 2022-02-14 17:08:21.000000000 +0000 +++ breathe-4.34.0/setup.py 2022-06-20 18:46:49.000000000 +0000 @@ -10,14 +10,14 @@ import sys # Keep in sync with breathe/__init__.py __version__ -__version__ = "4.33.1" +__version__ = "4.34.0" long_desc = """ Breathe is an extension to reStructuredText and Sphinx to be able to read and render `Doxygen `__ xml output. """ -requires = ["Sphinx>=3.0,<5", "docutils>=0.12"] +requires = ["Sphinx>=4.0,<6,!=5.0.0", "docutils>=0.12"] if sys.version_info < (3, 6): print("ERROR: Sphinx requires at least Python 3.6 to run.")