Skip to content

SOURCE_DATE_EPOCH overwriting user specification #13231

Closed as not planned
Closed as not planned

Description

@kquick

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

Activity

  1. AA-Turner commented on Jan 10, 2025

    @AA-Turner
    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

  2. added
    awaiting:response
    on Jan 10, 2025
  3. locked as resolved and limited conversation to collaborators on Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting:responseinternals:configtype:bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions