Anonymous avatar Anonymous committed 5c5755b

lowering the irrational versions to 3%

Comments (0)

Files changed (2)

         self.assertEquals(suggest('2.4pre1') , '2.4c1')
         self.assertEquals(suggest('2.1-rc2'), '2.1c2')
 
+        # from pypi
+        self.assertEquals(suggest('0.1dev'), '0.1.dev0')
+        self.assertEquals(suggest('0.1.dev'), '0.1.dev0')
+
 def test_suite():
     #README = os.path.join(os.path.dirname(__file__), 'README.txt')
     #suite = [doctest.DocFileSuite(README), unittest.makeSuite(VersionTestCase)]
     # PyPI stats: ~21 (0.62%) better
     rs = re.sub(r"\.?(pre|preview|-c)(\d+)$", r"c\g<2>", rs)
 
+    # a terminal ".dev" can be changed into ".dev0"
+    rs = re.sub(r"[\.\-]dev$", r".dev0", rs)
+
+    # a terminal "dev" can be changed into ".dev0"
+    rs = re.sub(r"(?![\.\-])dev$", r".dev0", rs)
+
+    # a terminal "final" or "stable" can be removed
+    rs = re.sub(r"(final|stable)$", "", rs)
+
     try:
         NormalizedVersion(rs)
         return rs   # already rational
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.