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

sdist: Accept -u/--owner and -g/--group options #2800

Merged
merged 1 commit into from Sep 26, 2021

Conversation

jmarshall
Copy link
Contributor

Summary of changes

Controlling the file ownership recorded in tar archives is useful for those striving towards reproducible builds, as discussed in #1893. These options are already understood by distutils.command.sdist.sdist, so just need to be accepted by setuptools.command.sdist.sdist to be propagated.

I didn't see any tests of the adjacent sdist options such as --keep-temp or --dist-dir, so as the change is to data only and effectively just forwards to already existing distutils code, I haven't added any additional tests. If there is somewhere appropriate to add a new test, please recommend where and I will add something appropriate. A similar comment applies to documentation.

Closes #1893.

Pull Request Checklist

Controlling the file ownership recorded in tar archives is useful for
those striving towards reproducible builds. These options are already
understood by distutils.command.sdist.sdist, so just need to be accepted
by setuptools.command.sdist.sdist to be propagated.

Fixes pypa#1893.
@jaraco
Copy link
Member

jaraco commented Sep 26, 2021

Doing some more investigation, I see that this support was added to distutils in Python 2.7 and slated for Python 3.2, but rolled back (see 5f1980b and bpo-6516 and bpo-19544).

I wish I understood what factors led to the omission of other options from distutils. It looks like the masking of distutils options was intentional in f3694a0.

Ideally, reproducible builds should be possible without supplying non-default options, but for now, this approach is the least invasive and should ease the merge with distutils.

@jaraco jaraco merged commit baaf8cd into pypa:main Sep 26, 2021
jmarshall added a commit to jmarshall/pysam that referenced this pull request Sep 28, 2021
Use --owner/--group to canonicalise the file ownership within the
sdist tarball. The job runs as runner/docker, which is meaningless
outside GH Actions' infrastructure.

Work around setuptools <= v58.1.0 which does not provide these options in
its (main) sdist command. This can be removed once pypa/setuptools#2800
appears in a release and has been deployed on Actions runners.
copybara-service bot pushed a commit to tink-crypto/tink-py that referenced this pull request Jul 5, 2022
 - Rename `build_linux` as `create_distribution_for_linux` and split it into two functions, one for wheels build and one for source distribution build
 - Rename `build_macos` as `create_distribution_for_macos`.
 - Add comments to functions
 - Remove `set_owner_within_tar` as this is no longer needed: since pypa/setuptools#2800 the parameters `--owner` and `--group` are propagated to setuptools.

PiperOrigin-RevId: 459048112
Change-Id: If9f2cbbaf9344d34c5f849bc3984631d1d519321
chuckx pushed a commit to tink-crypto/tink that referenced this pull request Jul 12, 2022
 - Rename `build_linux` as `create_distribution_for_linux` and split it into two functions, one for wheels build and one for source distribution build
 - Rename `build_macos` as `create_distribution_for_macos`.
 - Add comments to functions
 - Remove `set_owner_within_tar` as this is no longer needed: since pypa/setuptools#2800 the parameters `--owner` and `--group` are propagated to setuptools.

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

Successfully merging this pull request may close these issues.

Please restore --owner= and --group= options to setuptools' sdist command
2 participants