Commit e08d51e6 authored by Xavier Thompson's avatar Xavier Thompson

Consider only local egg paths when bootstrapping

By default egg installation considers the path where buildout
and other build tools such as setuptools are installed to see
if the requested eggs are already installed there.

With the new bootstrapping behavior, bootstrap should install
buildout and the other build tools in the local egg directory
even if the pinned versions are already installed in sys.path.
parent 2808e930
......@@ -631,6 +631,7 @@ class Buildout(DictMixin):
path=path,
newest=self.newest,
allow_hosts=self._allow_hosts,
strict_path=True,
)
else:
# Now copy buildout and setuptools eggs, and record destination eggs:
......
......@@ -255,6 +255,7 @@ class Installer(object):
allow_hosts=('*',),
check_picked=True,
allow_unknown_extras=False,
strict_path=False,
):
assert executable == sys.executable, (executable, sys.executable)
self._dest = dest if dest is None else pkg_resources.normalize_path(dest)
......@@ -275,8 +276,7 @@ class Installer(object):
links.insert(0, self._download_cache)
self._index_url = index
path = (path and path[:] or []) + buildout_and_setuptools_path
self._path = path
self._path = self._make_path(path, strict_path)
if self._dest is None:
newest = False
self._newest = newest
......@@ -288,6 +288,13 @@ class Installer(object):
if versions is not None:
self._versions = normalize_versions(versions)
def _make_path(self, path, strict_path):
if strict_path:
return path and path[:] or []
else:
# add buildout and setuptools path
return (path and path[:] or []) + buildout_and_setuptools_path
def _make_env(self):
full_path = self._get_dest_dist_paths() + self._path
env = pkg_resources.Environment(full_path)
......@@ -957,6 +964,7 @@ def install(specs, dest,
allowed_eggs_from_site_packages=None,
check_picked=True,
allow_unknown_extras=False,
strict_path=False,
):
assert executable == sys.executable, (executable, sys.executable)
assert include_site_packages is None
......@@ -967,7 +975,8 @@ def install(specs, dest,
newest, versions, use_dependency_links,
allow_hosts=allow_hosts,
check_picked=check_picked,
allow_unknown_extras=allow_unknown_extras)
allow_unknown_extras=allow_unknown_extras,
strict_path=strict_path)
return installer.install(specs, working_set)
buildout_and_setuptools_dists = list(install(['zc.buildout'], None,
......
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