[WIP] setuptools: add support for reproducible source distributions #1512
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
I decided to take a look at making it possible to have reproducible outputs when using
python setup.py sdist
. This involve 2 changes: always sorting each archive entries so the order is deterministic, and supporting the use of the environment variableSOURCE_DATE_EPOCH
for setting the timestamp of all entries (the same variable is supported bywheel
to support reproducible .whl files withbdist_wheel
).I merged in part of distutils
archive_util.py
code from the Python 3.7 version (as well as backporting the tests).Note: When
SOURCE_DATE_EPOCH
, all timestamps will set to the current time (instead of using the files actual timestamps). I dropped support for thecompressed tar file
format. Thexz'ed tar-file
format is now supported with Python 3.4.TODO:
--help-formats
output