Skip to content

Support Docutils 1.0 doctests and table widths - #14673

Closed
adamtheturtle wants to merge 2 commits into
sphinx-doc:masterfrom
adamtheturtle:docutils-development-compatibility
Closed

adamtheturtle wants to merge 2 commits into
sphinx-doc:masterfrom
adamtheturtle:docutils-development-compatibility

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Support Docutils 1.0's literal-block doctests and string column widths. Restores doctest execution and highlighting, autosummary XML output, and text/LaTeX/Texinfo table rendering.

Validation: mypy and 63 relevant tests pass with locked dependencies; the same tests pass with Docutils development HEAD.

Split from #14672. Pygments expectations and intermittent tests are handled in #14674; those CI failures remain until it merges.

AI disclosure: OpenAI Codex generated the changes and description, ran checks, and submitted this PR at the owner's request; no human review is claimed.

@jayaddison

Copy link
Copy Markdown
Contributor

NB: recent commits to docutils have evolved the prerelease 1.0 behaviour some more, so tests here may fail again after merge/rebase -- and that's somewhat expected.

For example, the following commit in docutils upstream affects the RFC URL suffix (.html -> /): docutils/docutils@0b812bd

@jayaddison

Copy link
Copy Markdown
Contributor

To resolve the RFC URL diff failures, readable at: https://github.com/sphinx-doc/sphinx/actions/runs/35363871409/job/105661469094?pr=14673#step:10:7093

...figuring out how to allow the tests to variably accept both .html or / as the URL suffix, depending on the installed docutils version is a small puzzler.

Immediate ideas that spring to mind from me include:

  1. Allow check_xpath (the function that evaluates the declared expectations) to accept a multi-valued xpath argument -- and test each of the values, returning success if any of them succeed (however: this could be confusing in conjunction with the be_found parameter...).
    OR
  2. Use a regex-based HREF path as the xpath value (just kidding; this is not supported... yet?)
    OR
  3. Add a version-check on the runtime docutils library version within the test suite.

For simplicity I'd probably lean towards the third option here.

@jayaddison

Copy link
Copy Markdown
Contributor

A fourth option, to explore:

Is it possible to use a static, constant XPath that filters to nodes where the text() content of the <strong> elements within the @class='rfc external reference' (fairly precise-match) is as expected (e.g. RFC 1, Request For Comments #1), then navigates back to the hyperlink (<a>) nodes, and uses a check function to assert on the HTML attribute contents of href?

(I think it may be possible. the code diff would express this idea more neatly than my human-language description of it, I expect)

@AA-Turner

Copy link
Copy Markdown
Member

sorry, i missed this PR, thanks @adamtheturtle. i think it's obsoleted now.

@AA-Turner AA-Turner closed this Oct 21, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants