[Python-checkins] distutils2 (merge default -> python3): Merge #11841 and other changes from default

eric.araujo python-checkins at python.org
Thu Oct 6 13:20:50 CEST 2011


http://hg.python.org/distutils2/rev/46c31c3c8839
changeset:   1199:46c31c3c8839
branch:      python3
parent:      1196:51bb31c537cb
parent:      1198:b42d7955f76a
user:        Éric Araujo <merwok at netwok.org>
date:        Wed Oct 05 01:10:36 2011 +0200
summary:
  Merge #11841 and other changes from default

files:
  distutils2/tests/test_version.py |  20 ++++++++++++++++----
  distutils2/version.py            |   2 +-
  2 files changed, 17 insertions(+), 5 deletions(-)


diff --git a/distutils2/tests/test_version.py b/distutils2/tests/test_version.py
--- a/distutils2/tests/test_version.py
+++ b/distutils2/tests/test_version.py
@@ -101,7 +101,17 @@
         True
         >>> V('1.2.0') >= V('1.2.3')
         False
-        >>> (V('1.0') > V('1.0b2'))
+        >>> V('1.2.0rc1') >= V('1.2.0')
+        False
+        >>> V('1.0') > V('1.0b2')
+        True
+        >>> V('1.0') > V('1.0c2')
+        True
+        >>> V('1.0') > V('1.0rc2')
+        True
+        >>> V('1.0rc2') > V('1.0rc1')
+        True
+        >>> V('1.0c4') > V('1.0c1')
         True
         >>> (V('1.0') > V('1.0c2') > V('1.0c1') > V('1.0b2') > V('1.0b1')
         ...  > V('1.0a2') > V('1.0a1'))
@@ -129,6 +139,8 @@
         ...  < V('1.0.dev18')
         ...  < V('1.0.dev456')
         ...  < V('1.0.dev1234')
+        ...  < V('1.0rc1')
+        ...  < V('1.0rc2')
         ...  < V('1.0')
         ...  < V('1.0.post456.dev623')  # development version of a post release
         ...  < V('1.0.post456'))
@@ -236,9 +248,9 @@
     def test_parse_numdots(self):
         # For code coverage completeness, as pad_zeros_length can't be set or
         # influenced from the public interface
-        self.assertEqual(V('1.0')._parse_numdots('1.0', '1.0',
-                                                  pad_zeros_length=3),
-                          [1, 0, 0])
+        self.assertEqual(
+            V('1.0')._parse_numdots('1.0', '1.0', pad_zeros_length=3),
+            [1, 0, 0])
 
 
 def test_suite():
diff --git a/distutils2/version.py b/distutils2/version.py
--- a/distutils2/version.py
+++ b/distutils2/version.py
@@ -253,7 +253,7 @@
     # if we have something like "b-2" or "a.2" at the end of the
     # version, that is pobably beta, alpha, etc
     # let's remove the dash or dot
-    rs = re.sub(r"([abc|rc])[\-\.](\d+)$", r"\1\2", rs)
+    rs = re.sub(r"([abc]|rc)[\-\.](\d+)$", r"\1\2", rs)
 
     # 1.0-dev-r371 -> 1.0.dev371
     # 0.1-dev-r79 -> 0.1.dev79

-- 
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list