[Checkins] SVN: z3c.checkversions/trunk/ Fixed edge case bug where 1.0 was never updated to 1.0.x

Christophe Combelles ccomb at free.fr
Tue Aug 24 20:04:34 EDT 2010


Log message for revision 115925:
  Fixed edge case bug where 1.0 was never updated to 1.0.x
  

Changed:
  U   z3c.checkversions/trunk/CHANGELOG.txt
  U   z3c.checkversions/trunk/z3c/checkversions/base.py
  U   z3c.checkversions/trunk/z3c/checkversions/buildout.txt
  U   z3c.checkversions/trunk/z3c/checkversions/testindex/zope.component/index.html

-=-
Modified: z3c.checkversions/trunk/CHANGELOG.txt
===================================================================
--- z3c.checkversions/trunk/CHANGELOG.txt	2010-08-24 20:31:25 UTC (rev 115924)
+++ z3c.checkversions/trunk/CHANGELOG.txt	2010-08-25 00:04:34 UTC (rev 115925)
@@ -1,10 +1,10 @@
 Changelog
 =========
 
-0.5 (unreleased)
-----------------
+0.4.1 (unreleased)
+------------------
 
-- ...
+- fixed edge case bug where 1.0 was never updated to 1.0.x
 
 0.4 (2010-07-26)
 ----------------

Modified: z3c.checkversions/trunk/z3c/checkversions/base.py
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/base.py	2010-08-24 20:31:25 UTC (rev 115924)
+++ z3c.checkversions/trunk/z3c/checkversions/base.py	2010-08-25 00:04:34 UTC (rev 115925)
@@ -98,7 +98,20 @@
                     continue
                 if not _final_version(dist.parsed_version):
                     continue
-                if dist.parsed_version[:level] > parsed_version[:level]:
+                # trunk the version tuple to the first `level` elements
+                trunked_current = list(parsed_version[:level])
+                trunked_candidate = list(dist.parsed_version[:level])
+                # remove *final and pad both to the level length
+                if '*final' in trunked_candidate:
+                    trunked_candidate.remove('*final')
+                while len(trunked_candidate) < level:
+                    trunked_candidate.append('00000000')
+                if '*final' in trunked_current:
+                    trunked_current.remove('*final')
+                while len(trunked_current) < level:
+                    trunked_current.append('00000000')
+                # ok now we can compare: -> skip if we're still higher.
+                if trunked_candidate > trunked_current:
                     continue
                 new_dist = dist
                 break

Modified: z3c.checkversions/trunk/z3c/checkversions/buildout.txt
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/buildout.txt	2010-08-24 20:31:25 UTC (rev 115924)
+++ z3c.checkversions/trunk/z3c/checkversions/buildout.txt	2010-08-25 00:04:34 UTC (rev 115925)
@@ -10,7 +10,7 @@
 >>> print testindex
 file:///.../testindex
 
-We create a buildout with a versions section and a custom index:
+We create a buildout with a [versions] section and a custom index:
 
 >>> import os
 >>> from tempfile import mkstemp
@@ -22,7 +22,7 @@
 ... versions = versions
 ... [versions]
 ... zope.interface = 3.4.0
-... zope.component = 3.4.0
+... zope.component = 3.0.0
 ... """ % testindex)
 >>> buildout_file.close()
 
@@ -32,7 +32,7 @@
 >>> checker = buildout.Checker(filename=buildout_path)
 >>> checker.get_versions()
 # Checking buildout file ...
-{'zope.interface': '3.4.0', 'zope.component': '3.4.0'}
+{'zope.interface': '3.4.0', 'zope.component': '3.0.0'}
 >>> checker.check()
 # Checking buildout file ...
 Reading file:///.../zope.interface/
@@ -45,7 +45,9 @@
 >>> checker.check(level=2)
 # Checking buildout file ...
 zope.interface=3.4.1
+zope.component=3.0.3
 
+
 We can provide a different index url:
 
 >>> checker = buildout.Checker(filename=buildout_path, index_url=testindex2)
@@ -64,7 +66,7 @@
 Reading file:///.../zope.interface/
 zope.interface=3.4.1 # was: 3.4.0
 Reading file:///.../zope.component/
-zope.component=3.4.0
+zope.component=3.0.3 # was: 3.0.0
 
 The old comments are removed:
 
@@ -77,7 +79,7 @@
 ... versions = versions
 ... [versions]
 ... zope.interface = 3.4.1 # was: 3.4.0
-... zope.component = 3.4.0
+... zope.component = 3.0.3
 ... """ % testindex)
 >>> buildout_file.close()
 
@@ -87,7 +89,7 @@
 Reading file:///.../zope.interface/
 zope.interface=3.6.1 # was: 3.4.1
 Reading file:///.../zope.component/
-zope.component=3.9.4 # was: 3.4.0
+zope.component=3.9.4 # was: 3.0.3
 
 We can provide a blacklist file, containing versions to not suggest.
 This file may come from a buildbot remembering failures.
@@ -107,7 +109,7 @@
 Reading file:///.../zope.interface/
 zope.interface=3.6.1 # was: 3.4.1
 Reading file:///.../zope.component/
-zope.component=3.9.2 # was: 3.4.0
+zope.component=3.9.2 # was: 3.0.3
 
 We can let the checker to suggest only one new package. This should be used to
 test a just single new package against a set of other packages.
@@ -120,7 +122,7 @@
 # Checking buildout file ...
 Reading file:///.../zope.interface/
 zope.interface=3.6.1 # was: 3.4.1
-zope.component=3.4.0
+zope.component=3.0.3
 
 >>> os.remove(blacklist_path)
 >>> os.remove(buildout_path)

Modified: z3c.checkversions/trunk/z3c/checkversions/testindex/zope.component/index.html
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/testindex/zope.component/index.html	2010-08-24 20:31:25 UTC (rev 115924)
+++ z3c.checkversions/trunk/z3c/checkversions/testindex/zope.component/index.html	2010-08-25 00:04:34 UTC (rev 115925)
@@ -12,7 +12,7 @@
 <a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.5.1.tar.gz#md5=006c43ad77ed4982e49c07f6e65b68a2">zope.component</a>
 <a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.5.0.tar.gz#md5=9f78c8c3594c27be9d6d84114b237ab3">zope.component</a>
 <a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.4.0.tar.gz#md5=94afb57dfe605d7235ff562d1eaa3bed">zope.component</a>
-<a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.4dev-r72749.tar.gz#md5=23625ac9ec78f1098a3bbc7f6bf86ca4">zope.component</a>
-<a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.4dev-r72748.tar.gz#md5=fe51ceddb7db4ff7630a91dee4525235">zope.component</a>
-<a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.4dev-r72747.tar.gz#md5=f352802dfbc1d1728a30784617976137">zope.component</a>
-<a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.4dev-r72605.tar.gz#md5=6c7f82343c4008a6cf547fb23227448c">zope.component</a>
+<a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.0.3.tar.gz#md5=23625ac9ec78f1098a3bbc7f6bf86ca4">zope.component</a>
+<a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.0.2.tar.gz#md5=fe51ceddb7db4ff7630a91dee4525235">zope.component</a>
+<a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.0.1.tar.gz#md5=f352802dfbc1d1728a30784617976137">zope.component</a>
+<a href="http://pypi.python.org/packages/source/z/zope.component/zope.component-3.0.0.tar.gz#md5=6c7f82343c4008a6cf547fb23227448c">zope.component</a>



More information about the checkins mailing list