Commit bf8d269f authored by Xavier Thompson's avatar Xavier Thompson

Fix bootstrap to let it install recent zc.buildout

Remove hardcoded dependencies of zc.buildout in bootstrap: easy_install
will anyway install all the actual dependencies of the pinned version
of zc.buildout, and return a working set containing them all.

Before this, when the pinned zc.buildout had other dependencies than
the ones hardcoded, they were installed correctly but bootstrap took
only the hardcoded ones into account and wrongly failed due to the
other dependencies being missing.

This is needed for buildout 3 because the dependencies now include
pip and wheel in addition to setuptools.
parent e9c39301
......@@ -540,41 +540,37 @@ class Buildout(DictMixin):
# Now copy buildout and setuptools eggs, and record destination eggs:
entries = []
options = self['buildout']
distributions = ['zc.buildout', 'setuptools']
distributions = ['zc.buildout']
try:
import slapos.libnetworkcache
except ImportError:
pass
else:
distributions.append('slapos.libnetworkcache')
for name in distributions:
if [x for x in sys.argv if \
(name == 'setuptools' and \
re.match(r'^--setuptools-version(=|$)', x)) or \
(name == 'zc.buildout' and \
re.match(r'^--buildout-version(=|$)', x))]:
# Specified version is already installed by bootstrap script.
ws = pkg_resources.working_set
elif self.offline:
ws = zc.buildout.easy_install.working_set(
[name], options['executable'],
[options['develop-eggs-directory'],
options['eggs-directory']],
)
else:
ws = zc.buildout.easy_install.install(
[name], options['eggs-directory'],
links=self._links,
index=options.get('index'),
path=[options['develop-eggs-directory']],
newest=self.newest,
allow_hosts=self._allow_hosts,
)
r = pkg_resources.Requirement.parse(name)
dist = ws.find(r)
# Install buildout and dependent eggs following pinned versions.
dest = options['eggs-directory']
path = [options['develop-eggs-directory']]
if self.offline:
# Cannot install: just check requirements are already met
path.append(dest)
dest = None
ws = zc.buildout.easy_install.install(
distributions,
dest,
links=self._links,
index=options.get('index'),
path=path,
newest=self.newest,
allow_hosts=self._allow_hosts,
)
# If versions aren't pinned or if current modules match,
# nothing will be installed, but then we'll copy them to
# the local eggs or develop-eggs folder just after this.
for dist in ws:
if dist.precedence == pkg_resources.DEVELOP_DIST:
dest = os.path.join(options['develop-eggs-directory'],
name+'.egg-link')
dist.key + '.egg-link')
with open(dest, 'w') as f:
f.write(dist.location)
entries.append(dist.location)
......
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