Skip to content

Commit

Permalink
sdist: Accept -u/--owner and -g/--group options
Browse files Browse the repository at this point in the history
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 #1893.
  • Loading branch information
jmarshall committed Sep 22, 2021
1 parent a5ed0a8 commit 576dece
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog.d/2800.change.rst
@@ -0,0 +1,3 @@
Added ``--owner`` and ``--group`` options to the ``sdist`` command,
for specifying file ownership within the produced tarball (similarly
to the corresponding distutils ``sdist`` options).
4 changes: 4 additions & 0 deletions setuptools/command/sdist.py
Expand Up @@ -31,6 +31,10 @@ class sdist(sdist_add_defaults, orig.sdist):
('dist-dir=', 'd',
"directory to put the source distribution archive(s) in "
"[default: dist]"),
('owner=', 'u',
"Owner name used when creating a tar file [default: current user]"),
('group=', 'g',
"Group name used when creating a tar file [default: current group]"),
]

negative_opt = {}
Expand Down

0 comments on commit 576dece

Please sign in to comment.