On Fri, 23 Sep 2005 01:32 pm, you wrote:
> At 10:25 AM 9/23/2005 +1000, Richard Jones wrote:
> >I can only assume that setuptools is mutating the name/version in order to
> >generate a safe filename, but then passing the mutated name/version to
> > PyPI as the release identifier.
>
> I haven't attempted to reproduce Ian's problem, but I don't believe I'm
> doing this, at least not in the upload command.  I'll have to check.

Oh, I just changed the distutils upload command a little so that it could 
auto-register a release if someone tries to upload a file for a release 
they've not "setup.py registered"'ed yet.

It's submitted to the python sf.net tracker, but sf.net's being flaky at the 
moment so I don't have a direct URL.


    Richard
--- upload.py	2005-09-23 13:20:51.721558664 +1000
+++ /usr/local/lib/python2.5/distutils/command/upload.py	2005-09-23 11:32:37.000000000 +1000
@@ -70,17 +70,41 @@
             spawn(("gpg", "--detach-sign", "-a", filename),
                   dry_run=self.dry_run)
 
-        # Fill in the data
+        # Fill in the data - send all the meta-data in case we need to
+        # register a new release
         content = open(filename,'rb').read()
+        meta = self.distribution.metadata
         data = {
-            ':action':'file_upload',
-            'protcol_version':'1',
-            'name':self.distribution.get_name(),
-            'version':self.distribution.get_version(),
-            'content':(os.path.basename(filename),content),
-            'filetype':command,
-            'pyversion':pyversion,
-            'md5_digest':md5(content).hexdigest(),
+            # action
+            ':action': 'file_upload',
+            'protcol_version': '1',
+
+            # identify release
+            'name': meta.get_name(),
+            'version': meta.get_version(),
+
+            # file content
+            'content': (os.path.basename(filename),content),
+            'filetype': command,
+            'pyversion': pyversion,
+            'md5_digest': md5(content).hexdigest(),
+
+            # additional meta-data
+            'metadata_version' : '1.0',
+            'summary': meta.get_description(),
+            'home_page': meta.get_url(),
+            'author': meta.get_contact(),
+            'author_email': meta.get_contact_email(),
+            'license': meta.get_licence(),
+            'description': meta.get_long_description(),
+            'keywords': meta.get_keywords(),
+            'platform': meta.get_platforms(),
+            'classifiers': meta.get_classifiers(),
+            'download_url': meta.get_download_url(),
+            # PEP 314
+            'provides': meta.get_provides(),
+            'requires': meta.get_requires(),
+            'obsoletes': meta.get_obsoletes(),
             }
         comment = ''
         if command == 'bdist_rpm':

Attachment: pgpQ1rAj1Wopa.pgp
Description: PGP signature

_______________________________________________
Catalog-sig mailing list
Catalog-sig@python.org
http://mail.python.org/mailman/listinfo/catalog-sig

Reply via email to