Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] setuptools: add support for reproducible source distributions #1512

Closed
wants to merge 1 commit into from

Conversation

benoit-pierre
Copy link
Member

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 variable SOURCE_DATE_EPOCH for setting the timestamp of all entries (the same variable is supported by wheel to support reproducible .whl files with bdist_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 the compressed tar file format. The xz'ed tar-file format is now supported with Python 3.4.

TODO:

  • tests
  • news fragment
  • fix --help-formats output

@pganssle pganssle added Needs Triage Issues that need to be evaluated for severity and status. and removed Needs Triage Issues that need to be evaluated for severity and status. labels Oct 19, 2018
@pganssle pganssle added the draft label Nov 3, 2018
tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])
try:
for path in _find_sorted(base_dir):
tar.add(path, recursive=False, filter=_set_uid_gid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be simplified, now that python/cpython#2263 is merged? Same for the zip part.

@jaraco
Copy link
Member

jaraco commented Mar 21, 2020

There's a lot going on here. @benoit-pierre, what's the plan for this PR? I'm going to close it for now as it appears to have languished, but feel free to re-open or re-submit at any point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants