Skip to content

Commit ec325ea

Browse files
committed
COMP: Remove broken duplicate-declaration sed hack from doc CI
The "Remove Duplicate Declaration Warnings" step deleted line 6559 of Sphinx's domains/cpp.py, but in the pinned sphinx==7.2.6 that line is an unrelated template-parsing heuristic, not the duplicate-declaration warning (emitted elsewhere). The step therefore mutated an unrelated code path while suppressing nothing, and it relied on distutils, which is removed in Python 3.12. Drop the step and instead declare the intent in Sphinx configuration via suppress_warnings = ['duplicate_declaration.cpp']. The same ITK class is deliberately documented by multiple examples, so the duplicate is expected. The key is ignored by sphinx==7.2.6 and becomes effective once Sphinx is upgraded, after which the CTest warning exception can also be dropped.
1 parent 23f641f commit ec325ea

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/build-test-publish.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,6 @@ jobs:
319319
320320
echo "Workspace: ${{ github.workspace }}"
321321
322-
- name: Remove Duplicate Declaration Warnings
323-
run: |
324-
SITE_PACKAGES_DIR=$(python3 "-c" "from distutils import sysconfig; print(sysconfig.get_python_lib())")
325-
sed -i "6559d" ${SITE_PACKAGES_DIR}/sphinx/domains/cpp.py
326-
327322
- name: Restore ExternalData cache
328323
uses: actions/cache@v4
329324
with:

Formatting/conf.py.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ if os.environ.get("READTHEDOCS", "") == "True":
4545
# C++ is the primary (default) Sphinx domain.
4646
primary_domain = 'cpp'
4747

48+
# The same ITK class is intentionally documented by more than one example,
49+
# so the C++ domain reports duplicate declarations. Suppress that subtype
50+
# (effective on Sphinx versions that tag the warning).
51+
suppress_warnings = ['duplicate_declaration.cpp']
52+
4853
# Add any Sphinx extension module names here, as strings. They can be extensions
4954
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
5055
extensions = ['sphinx.ext.todo', 'sphinx.ext.imgmath', 'sphinx.ext.ifconfig',

0 commit comments

Comments
 (0)