Make the build reproducible
-import datetime as dt
import sys
import os
+import time
+import datetime as dt
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -28,15 +29,20 @@ intersphinx_mapping = {
"marshmallow": ("http://marshmallow.readthedocs.io/en/latest/", None),
}
+
+# Use SOURCE_DATE_EPOCH for reproducible build output
+# https://reproducible-builds.org/docs/source-date-epoch/
+build_date = dt.datetime.utcfromtimestamp(
+ int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))
+)
+
# The master toctree document.
master_doc = "index"
-
language = "en"
-
html_domain_indices = False
source_suffix = ".rst"
project = "webargs"
-copyright = f"2014-{dt.datetime.utcnow():%Y}, Steven Loria and contributors"
+copyright = f"2014-{build_date:%Y}, Steven Loria and contributors"
version = release = webargs.__version__
templates_path = ["_templates"]
exclude_patterns = ["_build"]
