[Python-modules-team] Bug#824266: Bug#824266: mkdocs: Please support SOURCE_DATE_EPOCH specification for build time stamps

Brian May bam at debian.org
Mon May 16 23:16:36 UTC 2016


Axel Beckert <abe at debian.org> writes:

> See https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal#Examples
> for some examples on how to implement support for SOURCE_DATE_EPOCH,
> including an example for Python.

Response from the upstream author (please consider replying to the
upstream bug report, not here):

"FYI, the Python example is wrong. If `SOURCE_DATE_EPOCH` is supposed to
be a Unix timestamp (number of seconds since epoch), then
`time.gmtime()` is not the Python equivalent. However,
`calendar.timegm(datetime.datetime.utcnow().utctimetuple())` or
`calendar.timegm(time.gmtime())` is. It is annoyingly complicated to get
a Unix timestamp in Python. Although Python >= 3.3 makes it easier with
`datetime.datetime.utcnow().timestamp()`.  Not sure how the `datetime`
module went so long without the ability to return a timestamp."
-- 
Brian May <bam at debian.org>



More information about the Python-modules-team mailing list