[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - publication.py:1.7 setup.py:1.27

Fred L. Drake, Jr. fred at zope.com
Mon Jun 14 16:46:43 EDT 2004


Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv5372/zpkgtools

Modified Files:
	publication.py setup.py 
Log Message:
let zkpgtools set the Trove development status based on the indicator in the
version number


=== Packages/zpkgtools/zpkgtools/publication.py 1.6 => 1.7 ===
--- Packages/zpkgtools/zpkgtools/publication.py:1.6	Tue Jun  8 14:53:47 2004
+++ Packages/zpkgtools/zpkgtools/publication.py	Mon Jun 14 16:46:40 2004
@@ -180,3 +180,22 @@
             return v
     else:
         return default
+
+
+
+ALPHA  = "Development Status :: 3 - Alpha"
+BETA   = "Development Status :: 4 - Beta"
+STABLE = "Development Status :: 5 - Production/Stable"
+
+def set_development_status(metadata, status):
+    if not metadata.classifiers:
+        metadata.classifiers = [status]
+        return
+    for i in range(len(metadata.classifiers)):
+        classifier = metadata.classifiers[i]
+        parts = [s.strip() for s in classifier.lower().split("::")]
+        if parts[0] == "development status":
+            metadata.classifiers[i] = status
+            break
+    else:
+        metadata.classifiers.append(status)


=== Packages/zpkgtools/zpkgtools/setup.py 1.26 => 1.27 ===
--- Packages/zpkgtools/zpkgtools/setup.py:1.26	Fri Jun 11 15:24:35 2004
+++ Packages/zpkgtools/zpkgtools/setup.py	Mon Jun 14 16:46:40 2004
@@ -16,6 +16,7 @@
 import errno
 import os
 import posixpath
+import re
 import sys
 
 from zpkgtools import include
@@ -103,6 +104,16 @@
         publication.load(f, metadata=self)
         if self.platforms:
             self.platforms = ", ".join(self.platforms)
+        m = re.match(r"\d+\.\d+(\.\d+)?(?:(?P<status>[ab])\d*)?$",
+                     self.version)
+        if m is not None:
+            devstatus = publication.STABLE
+            status = m.group("status")
+            if status == "a":
+                devstatus = publication.ALPHA
+            elif status == "b":
+                devstatus = publication.BETA
+            publication.set_development_status(self, devstatus)
 
     def scan(self, name, directory, reldir):
         init_py = os.path.join(directory, "__init__.py")




More information about the Zope-CVS mailing list