Commit c33f38e2 authored by Jim Fulton's avatar Jim Fulton

Fixes #326

Fixed a bug introduced in 2.6.0:
zc.buildout and its dependeoncies were reported as picked even when
their versions were fixed in a ``versions`` section.  Worse, when the
``update-versions-file`` option was used, the ``versions`` section was
updated needlessly on every run.
parent 7a1741fc
......@@ -4,7 +4,11 @@ Change History
2.7.1 (unreleased)
==================
- Nothing changed yet.
- Fixed a bug introduced in 2.6.0:
zc.buildout and its dependeoncies were reported as picked even when
their versions were fixed in a ``versions`` section. Worse, when the
``update-versions-file`` option was used, the ``versions`` section was
updated needlessly on every run.
2.7.0 (2017-01-30)
......
......@@ -558,8 +558,9 @@ class Installer:
self._links,
self._allow_hosts)
for dist in dists:
if self._dest is not None:
# Check whether we picked a version and, if we did, report it:
for dist in dists:
if not (
dist.precedence == pkg_resources.DEVELOP_DIST
or
......@@ -573,7 +574,8 @@ class Installer:
if not self._allow_picked_versions:
raise zc.buildout.UserError(
'Picked: %s = %s' % (dist.project_name, dist.version)
'Picked: %s = %s' % (dist.project_name,
dist.version)
)
return dists
......
......@@ -420,10 +420,8 @@ The versions file now contains the extra pin:
And re-running buildout doesn't report any picked versions anymore:
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Updating foo.
recipe v2
...
>>> 'picked' in system(buildout)
False
If you've enabled ``update-versions-file`` but not ``show-picked-versions``,
buildout will append the versions to your versions file anyway (without
......
......@@ -2408,12 +2408,12 @@ def wont_downgrade_due_to_prefer_final():
... parts =
... ''')
>>> [v] = [l.split('= >=', 1)[1].strip()
>>> [v] = [str(l.split('= >=', 1)[1].strip())
... for l in system(buildout+' -vv').split('\n')
... if l.startswith('zc.buildout = >=')]
>>> v == pkg_resources.working_set.find(
>>> v == str(pkg_resources.working_set.find(
... pkg_resources.Requirement.parse('zc.buildout')
... ).version
... ).version)
True
>>> write('buildout.cfg',
......@@ -3062,6 +3062,39 @@ def test_abi_tag_eggs():
...
"""
def test_buildout_doesnt_keep_adding_itself_to_versions():
r"""
We were constantly writing to versions.cfg for buildout and setuptools
>>> write('buildout.cfg',
... '''
... [buildout]
... parts =
... extends = versions.cfg
... show-picked-versions = true
... update-versions-file = versions.cfg
... extends = versions.cfg
... ''')
>>> write('versions.cfg',
... '''[versions]
... ''')
>>> _ = system(join('bin', 'buildout'))
>>> with open('versions.cfg') as f:
... versions = f.read()
>>> _ = system(join('bin', 'buildout'))
>>> _ = system(join('bin', 'buildout'))
>>> _ = system(join('bin', 'buildout'))
>>> with open('versions.cfg') as f:
... versions == f.read()
True
>>> cat('versions.cfg') # doctest: +ELLIPSIS
[versions]
<BLANKLINE>
# Added by buildout...
setuptools = 34.0.3
...
"""
if sys.platform == 'win32':
del buildout_honors_umask # umask on dohs is academic
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment