Repository: pypa/setuptools

Issue:
Please restore --owner= and --group= options to setuptools' sdist command
Tar archives record the Unix ownership (user and group) of each file they contain.  This can cause undesirable variation between source tarballs generated from the same VCS checkout but in different build environments, so `distutils.command.sdist.sdist` has options `--owner=[username]` and `--group=[groupname]` to override the recorded ownership.  However, `setuptools.command.sdist.sdist` supersedes the `user_options` array of its parent class and makes most of the options inaccessible, including `--owner` and `--group`.

Please restore these options.  The simplest change to achieve this would be to copy the `--owner` and `--group` array entries from `distutils.command.sdist.sdist.user_options` to `setuptools.command.sdist.sdist.user_options`.  I have written a monkeypatch in my `setup.py` that does exactly this, so I can confirm that no other changes to setuptools' code are required.  However, a more future-proof change would be to have setuptools.command.sdist.sdist copy its parent class's `user_options` array and *remove* only those entries that are definitely not wanted.
Please restore --owner= and --group= options to setuptools' sdist command
Tar archives record the Unix ownership (user and group) of each file they contain.  This can cause undesirable variation between source tarballs generated from the same VCS checkout but in different build environments, so `distutils.command.sdist.sdist` has options `--owner=[username]` and `--group=[groupname]` to override the recorded ownership.  However, `setuptools.command.sdist.sdist` supersedes the `user_options` array of its parent class and makes most of the options inaccessible, including `--owner` and `--group`.

Please restore these options.  The simplest change to achieve this would be to copy the `--owner` and `--group` array entries from `distutils.command.sdist.sdist.user_options` to `setuptools.command.sdist.sdist.user_options`.  I have written a monkeypatch in my `setup.py` that does exactly this, so I can confirm that no other changes to setuptools' code are required.  However, a more future-proof change would be to have setuptools.command.sdist.sdist copy its parent class's `user_options` array and *remove* only those entries that are definitely not wanted.


Discussion:
As a workaround, it looks like you can still put these options in your `setup.cfg` and they will be respected even with setuptools:

```ini
[sdist]
owner = root
group = root
```
As a workaround, it looks like you can still put these options in your `setup.cfg` and they will be respected even with setuptools:

```ini
[sdist]
owner = root
group = root
```

Resolving patch:
diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py
--- 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 = {}


Test patch: