Skip to content
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

SOURCE_DATE_EPOCH overwriting user specification #13231

Open
kquick opened this issue Jan 10, 2025 · 1 comment
Open

SOURCE_DATE_EPOCH overwriting user specification #13231

kquick opened this issue Jan 10, 2025 · 1 comment
Labels
awaiting:response Waiting for a response from the author of this issue internals:config type:bug

Comments

@kquick
Copy link

kquick commented Jan 10, 2025

Describe the bug

In PR #12516 changes were made to replace the Copyright date specified via the copyright variable in conf.py with a SOURCE_DATE_EPOCH setting.

  • This is not specified in the documentation anywhere, requiring code spelunking to determine why this is happening (esp. for build platforms where SOURCE_DATE_EPOCH is set to an unexpected value (this seems to be auto-set in some CI runner environments, yet not to a useful value).
  • This replacement is done whether the user specified the copyright date manually or if they use the %Y substitution requesting the system provide the copyright. It seems wrong to override a user's explicit setting of the copyright date, and I would suggest that the SOURCE_DATE_EPOCH correction only be performed if the user specified the %Y substitution.

How to Reproduce

  1. In conf.py, set copyright = '2024, me'
  2. export SOURCE_DATE_EPOCH=1
  3. run sphinx build and inspect the footer

Environment Information

Latest Sphinx, SOURCE_DATE_EPOCH=1

@AA-Turner
Copy link
Member

Hi Kevin,

Please can you confirm that this changed in Sphinx 8.1? The first version of the SOURCE_DATE_EPOCH copyright substitution appears in Sphinx 1.4, from 2016 (7a89015).

I realise we don't document SOURCE_DATE_EPOCH, and this should improve. Would you be willing to suggest wording, or open a PR?

The '%Y' substitution is very new, I only added it in #12910 (first appearing in Sphinx 8.1). Perhaps we could change behaviour, but we must consider backward compatibility in any change.

A

@AA-Turner AA-Turner added internals:config awaiting:response Waiting for a response from the author of this issue labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting:response Waiting for a response from the author of this issue internals:config type:bug
Projects
None yet
Development

No branches or pull requests

2 participants