Skip to content

Commit

Permalink
Fix IndexError when buildout.cfg had a package with a blank version pin.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Jun 11, 2012
1 parent ab0de92 commit 6a45c46
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Changelog
in buildout.
- ignore installed packages while searching for new versions, only look in
the package index (makes the test suite more reliable, among other things).
- fix IndexError: list index out of range when buildout.cfg had a package with
a blank version pin.

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


def get_versions(self):
Expand Down
24 changes: 24 additions & 0 deletions z3c/checkversions/buildout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,27 @@ We are using it directly here:
>>> p.stdout.read().lower().startswith('usage: ')
True


explicitly unpinned versions
----------------------------

it's possible to explicitly say you don't want a particular package to be
pinned.

>>> buildout_path = write_temp_file("""
... [buildout]
... index = %s
... versions = versions
... [versions]
... distribute =
... zope.component = 3.0.0
... """ % testindex)

>>> checker = buildout.Checker(filename=buildout_path, verbose=True)
>>> checker.check()
# Checking buildout file ...
distribute=
# was: 3.0.0
zope.component=3.9.4

>>> os.remove(buildout_path)

0 comments on commit 6a45c46

Please sign in to comment.