Commit bb65f71c authored by Xavier Thompson's avatar Xavier Thompson

[cleanup] Remove superfluous code after pip wheel

Now that we use `pip wheel` + `Wheel.install_as_egg` to produce
genuine eggs, we don't need to workaround the fact that we have
not-actually-egg `.egg` bundles anymore.

If we still do need to allow for non-eggs being installed in `~/.eggs`,
via extensions or others, we should revert this.
See https://github.com/buildout/buildout/pull/352
parent ee5fded5
...@@ -307,36 +307,15 @@ class Installer(object): ...@@ -307,36 +307,15 @@ class Installer(object):
self._versions = normalize_versions(versions) self._versions = normalize_versions(versions)
def _make_env(self): def _make_env(self):
full_path = self._get_dest_dist_paths() + self._path dest = self._dest
env = pkg_resources.Environment(full_path) full_path = [] if dest is None else [dest]
# this needs to be called whenever self._env is modified (or we could full_path.extend(self._path)
# make an Environment subclass): return pkg_resources.Environment(full_path)
self._eggify_env_dest_dists(env, self._dest)
return env
def _env_rescan_dest(self): def _env_rescan_dest(self):
self._env.scan(self._get_dest_dist_paths())
self._eggify_env_dest_dists(self._env, self._dest)
def _get_dest_dist_paths(self):
dest = self._dest dest = self._dest
if dest is None: if dest is not None:
return [] self._env.scan([dest])
eggs = glob.glob(os.path.join(dest, '*.egg'))
dists = [os.path.dirname(dist_info) for dist_info in
glob.glob(os.path.join(dest, '*', '*.dist-info'))]
return list(set(eggs + dists))
@staticmethod
def _eggify_env_dest_dists(env, dest):
"""
Make sure everything found under `dest` is seen as an egg, even if it's
some other kind of dist.
"""
for project_name in env:
for dist in env[project_name]:
if os.path.dirname(dist.location) == dest:
dist.precedence = pkg_resources.EGG_DIST
def _version_conflict_information(self, name): def _version_conflict_information(self, name):
"""Return textual requirements/constraint information for debug purposes """Return textual requirements/constraint information for debug purposes
......
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