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

Make build reproducible by reading envvar SOURCE_DATE_EPOCH if set #3430

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import os
import sys
import time

if sys.version_info >= (3, 11):
import tomllib
Expand Down Expand Up @@ -30,7 +31,9 @@
source_suffix = ".rst"
master_doc = "index"
project = project_data.get("name").upper()
year = datetime.datetime.now().date().year
year = datetime.datetime.utcfromtimestamp(
int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))
).year
copyright = f"2010–{year}" # noqa: RUF001
exclude_patterns = ["_build"]
release = project_data.get("version")
Expand Down