-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
jayaddison
wants to merge
12
commits into
sphinx-doc:master
Choose a base branch
from
jayaddison:discussion-13526/copyright-patterns-support-source-date-epoch
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Config: native 'SOURCE_DATE_EPOCH' pattern-replacement support #13538
jayaddison
wants to merge
12
commits into
sphinx-doc:master
from
jayaddison:discussion-13526/copyright-patterns-support-source-date-epoch
Conversation
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
… discussion-13526/copyright-patterns-support-source-date-epoch
Relates-to commit de4af25.
… discussion-13526/copyright-patterns-support-source-date-epoch
…t-source-date-epoch
don't worry about merging master, it takes up CI resource, we have a limit of ~15(?) concurrent jobs on the whole organisation |
jayaddison
commented
May 12, 2025
…t-source-date-epoch
…t-source-date-epoch
…t-source-date-epoch Conflicts: CHANGES.rst
…ATE_EPOCH` is enabled` Ref: sphinx-doc#13538 (review)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Sphinx provides support for a
%Y
year-substitution pattern that dynamically places the publication year into thecopyright
andproject_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 byevaluate_copyright_placeholders
were compatible with the patterns matched by the subsequently-runcorrect_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, but2000–%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 supportSOURCE_DATE_EPOCH
internally.References
Also depends upon a small fixup from #13537 to ensure that the test suite passes reliably when run in entirety.