File: 004-reproducible-doc.patch

package info (click to toggle)
python-gitlab 1%3A8.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,884 kB
  • sloc: python: 25,823; makefile: 171; ruby: 27; javascript: 3
file content (26 lines) | stat: -rw-r--r-- 920 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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

Index: python-pygitlab/docs/conf.py
===================================================================
--- python-pygitlab.orig/docs/conf.py
+++ python-pygitlab/docs/conf.py
@@ -16,6 +16,7 @@ from __future__ import unicode_literals
 
 import os
 import sys
+from time import time
 from datetime import datetime
 
 from sphinx.domains.python import PythonDomain
@@ -43,7 +44,8 @@ def setup(sphinx):
 
 
 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