Skip to content

Config: native 'SOURCE_DATE_EPOCH' pattern-replacement support #13538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

jayaddison
Copy link
Contributor

Purpose

Sphinx provides support for a %Y year-substitution pattern that dynamically places the publication year into the copyright and project_copyright configuration settings.

Additionally, we attempt to support reproducible builds when possible, using the SOURCE_DATE_EPOCH environment variable.

Previously, it was possible in some cases for %Y values to be replaced with reproducible output when the settings produced by evaluate_copyright_placeholders were compatible with the patterns matched by the subsequently-run correct_copyright_year method. In particular, this required use of ASCII hyphens as year-range separators (e.g. 2000-%Y would accept and allow publication year replacement since it uses an ASCII hyphen, but 2000–%Y would not, because that latter string uses an en-dash character as the range indicator).

To remove the requirement that these two methods are interleaved to function correctly, and to allow evaluate_copyright_placeholders to emit reproducible results for more-general-case patterns, allow that method to support SOURCE_DATE_EPOCH internally.

References

Also depends upon a small fixup from #13537 to ensure that the test suite passes reliably when run in entirety.

@AA-Turner
Copy link
Member

don't worry about merging master, it takes up CI resource, we have a limit of ~15(?) concurrent jobs on the whole organisation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants