You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hej,
this fixes the Docutils 1.0 compatibility issues reported in #14680.
Docutils 1.0 development versions represent native doctests as literal_block nodes and proportional table widths as strings.
Sphinx now recognizes both the old and new doctest forms when collecting, highlighting, and positioning them, while continuing to exclude ordinary pycon code blocks from doctest runs.
Autosummary now emits string widths on all supported Docutils versions.
The text, LaTeX, and Texinfo writers validate and convert integer or proportional string widths before arithmetic without mutating the doctree.
The declared docutils>=0.21,<0.23 dependency range is unchanged, as 1.0 is unreleased.
Support Docutils 1.0 doctests and table widths #14673 proposes a smaller fix for the same doctest and table-width changes.
It recognizes the new doctest node when assigning the language and collecting tests, but does not restore the existing handling of indented native doctests.
AI Disclosure
OpenAI Codex assisted with reviewing and generating parts of the compatibility changes nd regression tests.
For the shared node predicates and column-width conversion, their integrations nd the associated tests were AI reviewed and generated parts.
All AI-assisted work was reviewed and understood by me.
Sorry, after a bit of thinking, I thought I could do better.
I added native doctest handling to gettext extraction, where Docutils 1.0 doctests were still treated as ordinary literal_block nodes.
I also replaced/removed the shared column-width parser and replaced it with a direct int() conversion. Docutils 1.0 only changes widths from integers to numeric strings.
The previous helper only partially anticipated the planned Docutils 2.0 changes. It handled integral values such as 5*, but not decimal proportions such as 8.2*, fixed widths such as 2.5cm, or mixtures of fixed and proportional columns.
Those require table-level normalization and writer-specific handling, so I think they should be revisited/implemented together when Sphinx adds Docutils 2.0 support, with the minimal change here for now being enouhgh for 1.0.
d3ed5fa adds a shared parser for the text, LaTeX, and Texinfo writers so Docutils 1.0 integral strings remain supported.
Rejects floats instead of making LaTeX's incidental late truncation the default behavior for the Text and Texinfo writers.
The failures are flakey tests and the missing changes from #14689. I keep the separate, as they solve different issues, merging the two would resolve the Docutils HEAD failures.
Hej,
this fixes the Docutils 1.0 compatibility issues reported in #14680.
Docutils 1.0 development versions represent native doctests as literal_block nodes and proportional table widths as strings.
Sphinx now recognizes both the old and new doctest forms when collecting, highlighting, and positioning them, while continuing to exclude ordinary pycon code blocks from doctest runs.
Autosummary now emits string widths on all supported Docutils versions.
The text, LaTeX, and Texinfo writers validate and convert integer or proportional string widths before arithmetic without mutating the doctree.
The declared docutils>=0.21,<0.23 dependency range is unchanged, as 1.0 is unreleased.
Support Docutils 1.0 doctests and table widths #14673 proposes a smaller fix for the same doctest and table-width changes.
It recognizes the new doctest node when assigning the language and collecting tests, but does not restore the existing handling of indented native doctests.
AI Disclosure
OpenAI Codex assisted with reviewing and generating parts of the compatibility changes nd regression tests.
For the shared node predicates and column-width conversion, their integrations nd the associated tests were AI reviewed and generated parts.
All AI-assisted work was reviewed and understood by me.
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
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.
Purpose
Hej,
this fixes the Docutils 1.0 compatibility issues reported in #14680.
Docutils 1.0 development versions represent native doctests as
literal_blocknodes and proportional table widths as strings.Sphinx now recognizes both the old and new doctest forms when collecting, highlighting, and positioning them, while continuing to exclude ordinary
pyconcode blocks from doctest runs.Autosummary now emits string widths on all supported Docutils versions.
The text, LaTeX, and Texinfo writers validate and convert integer or proportional string widths before arithmetic without mutating the doctree.
The declared
docutils>=0.21,<0.23dependency range is unchanged, as 1.0 is unreleased.References
It recognizes the new doctest node when assigning the language and collecting tests, but does not restore the existing handling of indented native doctests.
AI Disclosure
OpenAI Codex assisted with reviewing and generating parts of the compatibility changes nd regression tests.
For the shared node predicates and column-width conversion, their integrations nd the associated tests were AI reviewed and generated parts.
All AI-assisted work was reviewed and understood by me.