summaryrefslogtreecommitdiff
path: root/numpy/f2py
diff options
context:
space:
mode:
authorBernhard M. Wiedemann <bwiedemann@suse.de>2017-09-27 15:52:48 +0200
committerBernhard M. Wiedemann <bwiedemann@suse.de>2017-09-27 21:46:47 +0200
commitb1ae9839b92334acc6e5fb56250b31fd47e42523 (patch)
tree4485c7e399db0a57dbca64c4cf142d02940f183f /numpy/f2py
parent7666d14a5b5c2d94ddb064db83e85d8b8656c7d5 (diff)
downloadnumpy-b1ae9839b92334acc6e5fb56250b31fd47e42523.tar.gz
ENH: Allow to override build date
and use gmtime in order to be independent of timezone in order to make builds reproducible. See https://reproducible-builds.org/ for why this is good and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable.
Diffstat (limited to 'numpy/f2py')
-rw-r--r--numpy/f2py/rules.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/f2py/rules.py b/numpy/f2py/rules.py
index 6a1f5ae6e..87f4ddd9c 100644
--- a/numpy/f2py/rules.py
+++ b/numpy/f2py/rules.py
@@ -107,6 +107,7 @@ for k in ['decl',
#################### Rules for C/API module #################
+generationtime = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
module_rules = {
'modulebody': """\
/* File: #modulename#module.c
@@ -114,7 +115,7 @@ module_rules = {
* f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
* written by Pearu Peterson <pearu@cens.ioc.ee>.
* See http://cens.ioc.ee/projects/f2py2e/
- * Generation date: """ + time.asctime(time.localtime(time.time())) + """
+ * Generation date: """ + time.asctime(time.gmtime(generationtime)) + """
* $R""" + """evision:$
* $D""" + """ate:$
* Do not edit this file directly unless you know what you are doing!!!