Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
number of tests, all because of the codecs/_multibytecodecs issue described
here (it's not a Py3K issue, just something Py3K discovers):
http://mail.python.org/pipermail/python-dev/2006-April/064051.html
Hye-Shik Chang promised to look for a fix, so no need to fix it here. The
tests that are expected to break are:
test_codecencodings_cn
test_codecencodings_hk
test_codecencodings_jp
test_codecencodings_kr
test_codecencodings_tw
test_codecs
test_multibytecodec
This merge fixes an actual test failure (test_weakref) in this branch,
though, so I believe merging is the right thing to do anyway.
diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py
index 62767a3..6f4ce81 100644
--- a/Lib/distutils/command/upload.py
+++ b/Lib/distutils/command/upload.py
@@ -29,6 +29,7 @@
'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 @@
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 @@
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 - send all the meta-data in case we need to