diff options
author | PJ Eby <distutils-sig@python.org> | 2006-03-29 21:45:01 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2006-03-29 21:45:01 +0000 |
commit | 529b06d3717fdeb6a2070fa69b5c13cf0dff679f (patch) | |
tree | 907351aa8b2cf710a71f4b25050d137f2c1aed33 | |
parent | b6bb33146ec5f15e4439b758687d3bdcabae69e9 (diff) | |
download | external_python_setuptools-529b06d3717fdeb6a2070fa69b5c13cf0dff679f.tar.gz external_python_setuptools-529b06d3717fdeb6a2070fa69b5c13cf0dff679f.tar.bz2 external_python_setuptools-529b06d3717fdeb6a2070fa69b5c13cf0dff679f.zip |
Added ``--identity`` option to ``upload`` command.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4043427
-rwxr-xr-x | setuptools.txt | 7 | ||||
-rwxr-xr-x | setuptools/command/upload.py | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/setuptools.txt b/setuptools.txt index b24dc93c..a9176a9f 100755 --- a/setuptools.txt +++ b/setuptools.txt @@ -2156,6 +2156,11 @@ The ``upload`` command has a few options worth noting: Sign each uploaded file using GPG (GNU Privacy Guard). The ``gpg`` program must be available for execution on the system ``PATH``. +``--identity=NAME, -i NAME`` + Specify the identity or key name for GPG to use when signing. The value of + this option will be passed through the ``--local-user`` option of the + ``gpg`` program. + ``--show-response`` Display the full response text from server; this is useful for debugging PyPI problems. @@ -2366,6 +2371,8 @@ Release Notes/Change History ---------------------------- 0.6a11 + * Added ``--identity`` option to ``upload`` command. + * Added ``dependency_links`` to allow specifying URLs for ``--find-links``. * Enhanced test loader to scan packages as well as modules, and call diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py index 94190c2a..23cd0de9 100755 --- a/setuptools/command/upload.py +++ b/setuptools/command/upload.py @@ -29,6 +29,7 @@ class upload(Command): 'display full response text from server'), ('sign', 's', 'sign files to upload using gpg'), + ('identity=', 'i', 'GPG identity used to sign files'), ] boolean_options = ['show-response', 'sign'] @@ -38,8 +39,13 @@ class upload(Command): self.repository = '' self.show_response = 0 self.sign = False + self.identity = None def finalize_options(self): + if self.identity and not self.sign: + raise DistutilsOptionError( + "Must use --sign for --identity to have meaning" + ) if os.environ.has_key('HOME'): rc = os.path.join(os.environ['HOME'], '.pypirc') if os.path.exists(rc): @@ -67,7 +73,10 @@ class upload(Command): def upload_file(self, command, pyversion, filename): # Sign if requested if self.sign: - spawn(("gpg", "--detach-sign", "-a", filename), + gpg_args = ["gpg", "--detach-sign", "-a", filename] + if self.identity: + gpg_args[2:2] = ["--local-user", self.identity)] + spawn(gpg_args, dry_run=self.dry_run) # Fill in the data |