mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Make build reproducible by reading envvar SOURCE_DATE_EPOCH if set
This commit is contained in:
parent
07c7eacab9
commit
7adc87bd3e
1 changed files with 2 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import datetime
|
||||
import os
|
||||
import time
|
||||
import sys
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
|
|
@ -30,7 +31,7 @@ extensions = [
|
|||
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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue