Commit f0e77673 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Xavier Thompson

[feat] Include slapos.libnetworkcache when upgrading buildout script

parent b420cb22
...@@ -1262,8 +1262,17 @@ class Buildout(DictMixin): ...@@ -1262,8 +1262,17 @@ class Buildout(DictMixin):
if not self.newest: if not self.newest:
return return
# Hack: propagate libnetworkcache soft dependency
# XXX just zc.buildout should suffice, then iter over projects in ws
specs = ['zc.buildout', 'setuptools', 'pip', 'wheel']
try:
import slapos.libnetworkcache
specs.append('slapos.libnetworkcache')
except ImportError:
pass
ws = zc.buildout.easy_install.install( ws = zc.buildout.easy_install.install(
('zc.buildout', 'setuptools', 'pip', 'wheel'), specs,
self['buildout']['eggs-directory'], self['buildout']['eggs-directory'],
links = self['buildout'].get('find-links', '').split(), links = self['buildout'].get('find-links', '').split(),
index = self['buildout'].get('index'), index = self['buildout'].get('index'),
...@@ -1273,7 +1282,7 @@ class Buildout(DictMixin): ...@@ -1273,7 +1282,7 @@ class Buildout(DictMixin):
upgraded = [] upgraded = []
for project in 'zc.buildout', 'setuptools', 'pip', 'wheel': for project in specs:
req = pkg_resources.Requirement.parse(project) req = pkg_resources.Requirement.parse(project)
dist = ws.find(req) dist = ws.find(req)
importlib.import_module(project) importlib.import_module(project)
......
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