Skip to content

Commit

Permalink
Make build reproducible by reading envvar SOURCE_DATE_EPOCH if set
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent-C committed Nov 30, 2024
1 parent 07c7eac commit 7adc87b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
import os
import time
import sys

if sys.version_info >= (3, 11):
Expand Down Expand Up @@ -30,7 +31,7 @@
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

0 comments on commit 7adc87b

Please sign in to comment.