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 (#3430)
Co-authored-by: Justin Mayer <entroP@gmail.com>
This commit is contained in:
parent
64be147463
commit
5be013d9d2
1 changed files with 4 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import datetime
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
import tomllib
|
||||
|
|
@ -30,7 +31,9 @@ extensions = [
|
|||
source_suffix = ".rst"
|
||||
master_doc = "index"
|
||||
project = project_data.get("name").upper()
|
||||
year = datetime.datetime.now().date().year
|
||||
year = datetime.datetime.fromtimestamp(
|
||||
int(os.environ.get("SOURCE_DATE_EPOCH", time.time())), datetime.timezone.utc
|
||||
).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