Commit 9b693f15 authored by Thomas Leymonerie's avatar Thomas Leymonerie

src/zc/buildout: Add cond if slapos picked versions

parent 7a9f7b40
......@@ -564,7 +564,7 @@ class Installer:
wheel = getattr(requirement, 'wheel', False)
dists = [dist for dist in index[requirement.project_name]
if ((dist in requirement)
and (dist.precedence == WHL_DIST) == wheel and
and ((dist.precedence == WHL_DIST) == wheel or self._is_dist_picked(dist, requirement)) and
((not source) or
(dist.precedence == pkg_resources.SOURCE_DIST)
)
......@@ -581,6 +581,9 @@ class Installer:
# There are final dists, so only use those
dists = fdists
# Filter out wheels if possible
dists = [d for d in dists if d.precedence != WHL_DIST] or dists
# Now find the best one:
best = []
bestv = None
......@@ -742,13 +745,7 @@ class Installer:
if self._check_picked:
# Check whether we picked a version and, if we did, report it:
for dist in dists:
if not (
dist.precedence == pkg_resources.DEVELOP_DIST
or
(len(requirement.specs) == 1
and
requirement.specs[0][0] == '==')
):
if self._is_dist_picked(dist, requirement):
logger.debug('Picked: %s = %s',
dist.project_name, dist.version)
self._picked_versions[dist.project_name] = dist.version
......@@ -761,6 +758,16 @@ class Installer:
return dists
def _is_dist_picked(self, dist, requirement):
return not (
dist.precedence == pkg_resources.DEVELOP_DIST
or
(len(requirement.specs) == 1
and
requirement.specs[0][0] == '=='
)
)
def _maybe_add_setuptools(self, ws, dist):
if dist.has_metadata('namespace_packages.txt'):
for r in dist.requires():
......
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