Skip to content

Source date epoch docutils - #14778

Open
Darlokt wants to merge 5 commits into
sphinx-doc:masterfrom
Darlokt:source-date-epoch-docutils
Open

Darlokt wants to merge 5 commits into
sphinx-doc:masterfrom
Darlokt:source-date-epoch-docutils

Conversation

@Darlokt

@Darlokt Darlokt commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Purpose

Hej,
as requested by @AA-Turner, here is the third of 3 more reviewable split up of the main PR #14770 targeting the SOURCE_DATE_EPOCH behavior and related fixes.

With Docutils versions before 1.0, Sphinx's |today| substitution can use SOURCE_DATE_EPOCH while the Docutils date directive still uses the system clock. Configured datestamp footers have the same problem, and their dates remain in cached doctrees. This change adds compatibility adapters that use the supplied epoch in UTC. Docutils 1.0 retains its native implementations.

The directive adapter preserves custom formats, invalid-context diagnostics, and extension overrides. The footer adapter leaves footer construction to Docutils, preserving literal percent signs, generator credits, and source links. It restores the original format setting even if footer generation fails. Unset and empty epochs retain current-time behavior, and disabled datestamps remain disabled.

The change includes tests, documentation, and a changelog entry. It extends the incremental coverage with Docutils date substitutions and XML footer output, including selected-file and parallel builds.

References

AI Disclosure

OpenAI Codex assisted with splitting up #14770. All AI-assisted work was reviewed and understood by me.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant