Commit 48796ac8 authored by Reinout van Rees's avatar Reinout van Rees Committed by GitHub

Merge pull request #441 from buildout/reinout-correct-upgrade-with-extension

Correctly detect upgrade with extension that depends on setuptools
parents d6dcdd8f 94ff5a69
......@@ -4,7 +4,9 @@ Change History
2.11.1 (unreleased)
===================
- Nothing changed yet.
- Made upgrade check more robust. When using extensions, the improvement
introduced in 2.11 could prevent buildout from restarting itself when it
upgraded setuptools.
2.11.0 (2018-01-21)
......
......@@ -1083,10 +1083,13 @@ class Buildout(DictMixin):
)
upgraded = []
# The setuptools/zc.buildout locations at the time we started was
# recorded in easy_install.py. We use that here to check if we've been
# upgraded.
start_locations = zc.buildout.easy_install.buildout_and_setuptools_path
for project in 'zc.buildout', 'setuptools':
req = pkg_resources.Requirement.parse(project)
project_location = pkg_resources.working_set.find(req).location
if ws.find(req).location != project_location:
if ws.find(req).location not in start_locations:
upgraded.append(ws.find(req))
if not upgraded:
......
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