Skip to content

Fix two test samples to avoid new Docutils warning. - #14540

Merged
picnixz merged 4 commits into
sphinx-doc:masterfrom
gmilde:figure-warning
Aug 7, 2026
Merged

picnixz merged 4 commits into
sphinx-doc:masterfrom
gmilde:figure-warning

Conversation

@gmilde

@gmilde gmilde commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Fix CI test failures with Docutils HEAD.

Docutils 1.0 warns if a figure has no caption and no legend, as this leads to an invalid document tree.
The warning can be silenced by providing a caption (naturally) or by "cheating" with an empty comment.

Use an empty comment here for a minimal change.


Docutils commit r10373 changed the formatting of the HTML source to improve
readability (no change to normalized HTML or the rendering in a browser).
The added insignificant newline leads to a "false-negative" in a
Sphinx ebuild writer test.

Using a regexp search instead of a fixed substring search allows to test for the
correct output while ignoring optional insignificant whitespace.

References

Closes #14508.

Thanks to "ishaanlabs-gg" for a similar patch (#14511) that showed the location of the problematic samples (but was unfortunately closed due to a missing AI-use declaration).

AI Disclosure

No AI tools used by me.

The patch #14511 (missing an AI disclosure) was consulted to find the location of the
offending test samples.

Docutils 1.0 warns if a figure has no caption and no legend, as this
leads to an invalid document tree.
The warning can be silenced by providing a caption (naturally) or by
"cheating" with an empty comment.

Use an empty comment here for a minimal change.

Thanks to "ishaanlabs-gg" for a similar patch that showed the location of the
problematic sample (but was unfortunately closed due to a missing
AI-use declaration).
@gmilde

gmilde commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

The remaining error with Docutils HEAD and LaTeX is a false positive because of insignificant line-breaks in the HTML output document:
Docutils commit 10373 changed the formatting of the HTML source to improve readability -- no change to normalized HTML or the rendering in a browser.
Shall I add a fix here or in a separate PR?

@jdillard
jdillard self-requested a review July 20, 2026 19:47
@jdillard

Copy link
Copy Markdown
Member

I think it is fine to add the other fix to this PR since it is a small fix.

Docutils commit r10373 changed the formatting of the HTML source to improve
readability (no change to normalized HTML or the rendering in a browser).

The added insignificant newline leads to a "false-negative" in a
Sphinx ebuild writer test. Using a regexp search instead of a fixed
substring search allows to test for the correct output while ignoring
insignificant whitespace.

The fix is a "hand-revised" version of the second commit in PR sphinx-doc#14511
by ishaanlabs-gg (which was closed because of a missing AI disclosure).

No AI was used by me in preparing this patch.
@gmilde

gmilde commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

I added the second fix and updated the PR description.

Add a comma after the last function argument in long function call.
@jdillard jdillard added this to the 9.1.1 milestone Jul 22, 2026
@jdillard jdillard mentioned this pull request Jul 22, 2026
@kaycebasques

kaycebasques commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

The failing ty check should pass once #14538 merges

@kaycebasques

Copy link
Copy Markdown
Contributor

@picnixz I think this is the last of the fixes needed to get all CI checks functional again

@picnixz

picnixz commented Aug 6, 2026

Copy link
Copy Markdown
Member

I'll merge this after the GH outage is resolved.

@jdillard

jdillard commented Aug 7, 2026

Copy link
Copy Markdown
Member

Closing and re-opening to try and trigger the stale jobs from the GHA outage

@jdillard jdillard closed this Aug 7, 2026
@jdillard jdillard reopened this Aug 7, 2026
@jdillard

jdillard commented Aug 7, 2026

Copy link
Copy Markdown
Member

@picnixz All green now!

Thanks for making sure CI got fixed @kaycebasques

@picnixz
picnixz merged commit e44a40e into sphinx-doc:master Aug 7, 2026
27 checks passed
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid rST input in tests/test_intl/test_intl.py::test_text_figure_captions.

5 participants