File: 004-reproducible-doc.patch

package info (click to toggle)
python-gitlab 1%3A4.9.0-1.2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 3,076 kB
  • sloc: python: 24,172; makefile: 167; ruby: 27; javascript: 3
file content (24 lines) | stat: -rw-r--r-- 724 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: Vagrant Cascadian <vagrant@reproducible-builds.org> and Federico Ceratto <federico@debian.org>
Subject: Use SOURCE_DATE_EPOCH in setting doc build year
Forwarded: no

--- a/docs/conf.py
+++ b/docs/conf.py
@@ -17,6 +17,7 @@
 
 import os
 import sys
+from time import time
 from datetime import datetime
 
 from sphinx.domains.python import PythonDomain
@@ -44,7 +45,8 @@
 
 
 on_rtd = os.environ.get("READTHEDOCS", None) == "True"
-year = datetime.now().year
+ts = int(os.environ.get('SOURCE_DATE_EPOCH', time()))
+year = datetime.utcfromtimestamp(ts).year
 
 # 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