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