From 685b3bcd560479a69306f253f698377984dc1395 Mon Sep 17 00:00:00 2001 From: "Eric T. Johnson" Date: Thu, 16 Jan 2025 12:36:26 -0500 Subject: [PATCH] Fix building documentation in CI (#1008) * Remove clang runtime packages from `documentation.yml` * Convert `Path` to `str` where needed * Fix `AttributeError` with `compounddefTypeSub` --- .github/workflows/documentation.yml | 2 +- breathe/parser/compound.py | 2 +- breathe/parser/index.py | 2 +- breathe/process.py | 2 +- breathe/renderer/sphinxrenderer.py | 5 ++++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 3b4771541..cf78d48f9 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -29,7 +29,7 @@ jobs: - name: Install apt dependencies run: | sudo apt-get update - sudo apt-get install graphviz libclang1-11 libclang-cpp11 + sudo apt-get install graphviz - name: Install doxygen from SourceForge binary archives env: diff --git a/breathe/parser/compound.py b/breathe/parser/compound.py index cf858d7da..42d9f1488 100644 --- a/breathe/parser/compound.py +++ b/breathe/parser/compound.py @@ -1199,7 +1199,7 @@ class FileIOError(Exception): def parse(inFilename): try: - doc = minidom.parse(inFilename) + doc = minidom.parse(str(inFilename)) except OSError as e: raise FileIOError(e) except ExpatError as e: diff --git a/breathe/parser/index.py b/breathe/parser/index.py index d4f0634bf..7ca81d5a5 100644 --- a/breathe/parser/index.py +++ b/breathe/parser/index.py @@ -48,7 +48,7 @@ class FileIOError(Exception): def parse(inFilename): try: - doc = minidom.parse(inFilename) + doc = minidom.parse(str(inFilename)) except OSError as e: raise FileIOError(e) except ExpatError as e: diff --git a/breathe/process.py b/breathe/process.py index 2292ee5af..79890a89c 100644 --- a/breathe/process.py +++ b/breathe/process.py @@ -82,7 +82,7 @@ def process( doxygen_aliases: Dict[str, str], ) -> str: name = auto_project_info.name() - full_paths = [auto_project_info.abs_path_to_source_file(f) for f in files] + full_paths = [str(auto_project_info.abs_path_to_source_file(f)) for f in files] options = "\n".join("%s=%s" % pair for pair in doxygen_options.items()) aliases = "\n".join( diff --git a/breathe/renderer/sphinxrenderer.py b/breathe/renderer/sphinxrenderer.py index f1aa5035d..76c3b6419 100644 --- a/breathe/renderer/sphinxrenderer.py +++ b/breathe/renderer/sphinxrenderer.py @@ -687,7 +687,10 @@ def content(contentnode): assert isinstance(sig, addnodes.desc_signature) # Insert the member name for use in Sphinx-generated table of contents. - member_name = node.get_name() + if node.node_type == "compounddef": + member_name = node.compoundname + else: + member_name = node.name if obj_type == "function": member_name += "()" sig.attributes["_toc_name"] = member_name