Repository navigation
BUG: Refresh wrapping docstrings when Doxygen reruns - #7229
Merged
hjmjohnson merged 1 commit intoNov 25, 2026
Merged
hjmjohnson merged 1 commit into
hjmjohnson merged 1 commit into
Conversation
dzenanz
marked this pull request as ready for review
November 23, 2026 16:39
Contributor
[Medium impact] The changes affect Python documentation generation across ITK wrapping builds. The PR appears safe to merge, with a non-blocking request for focused converter tests. Findings
|
The doxy2swig commands depended only on each module's Doxygen target, which orders the build but does not trigger a rerun, so docstrings kept the text of their first build. They now also depend on the target's stamp file. A docstring file is rewritten only when its text changes, so SWIG reruns only for those submodules. With bibtex, Doxygen turns each \cite into an [N] label that indexes its HTML bibliography. Docstrings show the citation key instead and end with a References list taken from Doxygen's citelist.xml. PythonDoxy2SwigCitationTest converts a small Doxygen XML class with and without citelist.xml, and checks that unchanged output keeps its timestamp. It needs neither Doxygen nor ITK_WRAP_DOC.
dzenanz
force-pushed
the
wrapping-docstring-citations
branch
from
November 23, 2026 21:32
d9d963d to
24f0343
Compare
hjmjohnson
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python docstrings were not regenerated when Doxygen reran, so wheels kept stale text. With bibtex, citations also became bare
[N]labels; docstrings now show the citation key and a References list.Root cause and design
Stale docstrings. Each
_doc.icommand ingenerate_wrap_doc()depended only on the<module>Doxygentarget. A target dependency orders the build but never reruns the command, and the XML files cannot be listed because Doxygen does not declare them as outputs. The command now also depends on<module>Doxygen.stamp, whichdoxygen_add_docs(... USE_STAMP_FILE)documents as touched on every Doxygen run, and ondoxy2swig.py, whichitk_doxy2swig.pyimports.No needless SWIG reruns.
itk_doxy2swig.pyleaves a docstring file untouched when its text is unchanged, and Ninja'srestatthen skips SWIG for it. With Makefile or Visual Studio generators such a file stays older than the stamp, so its doxy2swig command reruns on later builds; SWIG still does not.Citations. With bibtex, Doxygen writes each
\citeas<ref refid="citelist_1CITEREF_key">[N]</ref>;Nonly indexes Doxygen's own bibliography page. Without bibtex it writes the key. Docstrings now show the key in both cases and, when Doxygen producedcitelist.xml, end with the cited entries:Keys taken from the reference id are lowercase, because the wrapping Doxygen configuration sets
CASE_SENSE_NAMES=NOon every platform.Testing
Windows, CMake 4.5.1, Ninja, MSVC 14.44, Doxygen 1.13.2, bibtex from MiKTeX. Minimal build of ITKPath, Strain and IsotropicWavelets with
ITK_WRAP_PYTHON=ONandITK_WRAP_DOC=ON, together with #7230's branch:_doc.ifiles have a References list; none contain an[N]label.itkContourExtractor2DImageFilter.h, onlyitkContourExtractor2DImageFilter_doc.iwas rewritten; the other six ITKPath docstring files kept their timestamps.PATHgives the same inline text; only the bibtex run adds References.PythonDoxy2SwigCitationTestconverts a small Doxygen XML class with and withoutcitelist.xmland checks the inline keys, the References list (a repeated citation is listed once), and that unchanged output keeps its timestamp. It needs neither Doxygen norITK_WRAP_DOC, and it fails with the converter from before this change.ctest -R "Python|Strain|Wavelet|Riesz|Path": 214 of 215 pass;PythonLazyImportTimealso fails with the 6.0b3 wheels.help()ofitk.ContourExtractor2DImageFiltershows the key and the References list.Not tested on Linux or macOS.
AI assistance
Claude Code (Opus 5.5) traced the stale docstrings in a wheel build log to the dependency, wrote the change, and ran the builds above.
🤖 Generated with Claude Code