From 576dece3643485052ba90fdadc81dfcf6028acc4 Mon Sep 17 00:00:00 2001 From: John Marshall Date: Wed, 22 Sep 2021 21:51:21 +0100 Subject: [PATCH] sdist: Accept -u/--owner and -g/--group options 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. --- changelog.d/2800.change.rst | 3 +++ setuptools/command/sdist.py | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 changelog.d/2800.change.rst diff --git a/changelog.d/2800.change.rst b/changelog.d/2800.change.rst new file mode 100644 index 0000000000..cbb201e70a --- /dev/null +++ b/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). diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index 4a014283c8..e8062f2e41 100644 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -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 = {}