aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_resources.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-12-06 17:41:36 +0000
committerPJ Eby <distutils-sig@python.org>2005-12-06 17:41:36 +0000
commitbd28408ff49d304ae822acf9f46f0b65bb138c04 (patch)
tree75cecab952c652149b44f488724f06b23a912917 /setuptools/tests/test_resources.py
parent45885095198f5ec1d7e80791a73c7385f2620b38 (diff)
downloadexternal_python_setuptools-bd28408ff49d304ae822acf9f46f0b65bb138c04.tar.gz
external_python_setuptools-bd28408ff49d304ae822acf9f46f0b65bb138c04.tar.bz2
external_python_setuptools-bd28408ff49d304ae822acf9f46f0b65bb138c04.zip
Changed ``parse_version()`` to remove dashes before pre-release tags, so
that ``0.2-rc1`` is considered an *older* version than ``0.2``, and is equal to ``0.2rc1``. The idea that a dash *always* meant a post-release version was highly non-intuitive to setuptools users and Python developers, who seem to want to use ``-rc`` version numbers a lot. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041630
Diffstat (limited to 'setuptools/tests/test_resources.py')
-rw-r--r--setuptools/tests/test_resources.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py
index 076dd53e..15b7acbd 100644
--- a/setuptools/tests/test_resources.py
+++ b/setuptools/tests/test_resources.py
@@ -434,19 +434,19 @@ class ParseTests(TestCase):
self.assertRaises(ValueError,Requirement.parse,"X==1\nY==2")
self.assertRaises(ValueError,Requirement.parse,"#")
-
def testVersionEquality(self):
def c(s1,s2):
p1, p2 = parse_version(s1),parse_version(s2)
self.assertEqual(p1,p2, (s1,s2,p1,p2))
+ c('1.2-rc1', '1.2rc1')
c('0.4', '0.4.0')
c('0.4.0.0', '0.4.0')
c('0.4.0-0', '0.4-0')
c('0pl1', '0.0pl1')
c('0pre1', '0.0c1')
c('0.0.0preview1', '0c1')
- c('0.0c1', '0rc1')
+ c('0.0c1', '0-rc1')
c('1.2a1', '1.2.a.1'); c('1.2...a', '1.2a')
def testVersionOrdering(self):
@@ -470,6 +470,7 @@ class ParseTests(TestCase):
c('0.4', '4.0')
c('0.0.4', '0.4.0')
c('0pl1', '0.4pl1')
+ c('2.1.0-rc1','2.1.0')
torture ="""
0.80.1-3 0.80.1-2 0.80.1-1 0.79.9999+0.80.0pre4-1
@@ -489,4 +490,3 @@ class ParseTests(TestCase):
-