[Python-checkins] r52001 - in sandbox/trunk/setuptools: pkg_resources.py pkg_resources.txt setuptools/tests/test_resources.py

phillip.eby python-checkins at python.org
Mon Sep 25 19:58:47 CEST 2006


Author: phillip.eby
Date: Mon Sep 25 19:58:46 2006
New Revision: 52001

Modified:
   sandbox/trunk/setuptools/pkg_resources.py
   sandbox/trunk/setuptools/pkg_resources.txt
   sandbox/trunk/setuptools/setuptools/tests/test_resources.py
Log:
Fix "dev" versions being considered newer than release candidates.  :(


Modified: sandbox/trunk/setuptools/pkg_resources.py
==============================================================================
--- sandbox/trunk/setuptools/pkg_resources.py	(original)
+++ sandbox/trunk/setuptools/pkg_resources.py	Mon Sep 25 19:58:46 2006
@@ -1665,7 +1665,7 @@
 ).match
 
 component_re = re.compile(r'(\d+ | [a-z]+ | \.| -)', re.VERBOSE)
-replace = {'pre':'c', 'preview':'c','-':'final-','rc':'c'}.get
+replace = {'pre':'c', 'preview':'c','-':'final-','rc':'c','dev':'@'}.get
 
 def _parse_version_parts(s):
     for part in component_re.split(s):

Modified: sandbox/trunk/setuptools/pkg_resources.txt
==============================================================================
--- sandbox/trunk/setuptools/pkg_resources.txt	(original)
+++ sandbox/trunk/setuptools/pkg_resources.txt	Mon Sep 25 19:58:46 2006
@@ -1546,7 +1546,8 @@
     Finally, to handle miscellaneous cases, the strings "pre", "preview", and
     "rc" are treated as if they were "c", i.e. as though they were release
     candidates, and therefore are not as new as a version string that does not
-    contain them.
+    contain them.  And the string "dev" is treated as if it were an "@" sign;
+    that is, a version coming before even "a" or "alpha".
 
 .. _yield_lines():
 

Modified: sandbox/trunk/setuptools/setuptools/tests/test_resources.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/tests/test_resources.py	(original)
+++ sandbox/trunk/setuptools/setuptools/tests/test_resources.py	Mon Sep 25 19:58:46 2006
@@ -471,6 +471,7 @@
         c('0.0.4', '0.4.0')
         c('0pl1', '0.4pl1')
         c('2.1.0-rc1','2.1.0')
+        c('2.1dev','2.1a0')
 
         torture ="""
         0.80.1-3 0.80.1-2 0.80.1-1 0.79.9999+0.80.0pre4-1
@@ -481,3 +482,12 @@
         for p,v1 in enumerate(torture):
             for v2 in torture[p+1:]:
                 c(v2,v1)
+
+
+
+
+
+
+
+
+


More information about the Python-checkins mailing list