Skip to content

Commit

Permalink
print old version comment on a separate line to make generated output…
Browse files Browse the repository at this point in the history
… usable in

buildout. Until now you would get
Error: Bad version 3.6.4 # was: 3.6.3
  • Loading branch information
menesis committed Aug 15, 2011
1 parent 381d2ef commit 35b700a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
0.5 (unreleased)
----------------

- ...
- print old version comment on a separate line to make generated output usable in
buildout.

0.4.1 (2010-08-25)
------------------
Expand Down
6 changes: 2 additions & 4 deletions z3c/checkversions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,8 @@ def check(self, level=0):
if self.incremental == True:
self.incremental = 'stop'
if self.verbose:
print("%s=%s # was: %s"
% (name, new_dist.version, version.split()[0]))
else:
print("%s=%s" % (name, new_dist.version))
print("# was: %s" % version.split()[0])
print("%s=%s" % (name, new_dist.version))
elif self.verbose:
print("%s=%s" % (name, version.split()[0]))

Expand Down
24 changes: 16 additions & 8 deletions z3c/checkversions/buildout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ The verbose mode gives the current and previous versions
>>> checker.check(level=2)
# Checking buildout file ...
Reading file:///.../zope.interface/
zope.interface=3.4.1 # was: 3.4.0
# was: 3.4.0
zope.interface=3.4.1
Reading file:///.../zope.component/
zope.component=3.0.3 # was: 3.0.0
# was: 3.0.0
zope.component=3.0.3

The old comments are removed:

Expand All @@ -78,7 +80,8 @@ The old comments are removed:
... index = %s
... versions = versions
... [versions]
... zope.interface = 3.4.1 # was: 3.4.0
... # was: 3.4.0
... zope.interface = 3.4.1
... zope.component = 3.0.3
... """ % testindex)
>>> buildout_file.close()
Expand All @@ -87,9 +90,11 @@ The old comments are removed:
>>> checker.check()
# Checking buildout file ...
Reading file:///.../zope.interface/
zope.interface=3.6.1 # was: 3.4.1
# was: 3.4.1
zope.interface=3.6.1
Reading file:///.../zope.component/
zope.component=3.9.4 # was: 3.0.3
# was: 3.0.3
zope.component=3.9.4

We can provide a blacklist file, containing versions to not suggest.
This file may come from a buildbot remembering failures.
Expand All @@ -107,9 +112,11 @@ This file may come from a buildbot remembering failures.
>>> checker.check()
# Checking buildout file ...
Reading file:///.../zope.interface/
zope.interface=3.6.1 # was: 3.4.1
# was: 3.4.1
zope.interface=3.6.1
Reading file:///.../zope.component/
zope.component=3.9.2 # was: 3.0.3
# was: 3.0.3
zope.component=3.9.2

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.
Expand All @@ -121,7 +128,8 @@ test a just single new package against a set of other packages.
>>> checker.check()
# Checking buildout file ...
Reading file:///.../zope.interface/
zope.interface=3.6.1 # was: 3.4.1
# was: 3.4.1
zope.interface=3.6.1
zope.component=3.0.3

>>> os.remove(blacklist_path)
Expand Down

0 comments on commit 35b700a

Please sign in to comment.