Commit 9f2cb274 authored by Julien Muchembled's avatar Julien Muchembled Committed by Xavier Thompson

Install egg from wheel only if explictly required

Egg is install from wheel the requested version ends with :whl

This replaces:
	<removed>
parent d8f19740
......@@ -39,6 +39,8 @@ import tempfile
import zc.buildout
import warnings
WHL_DIST = pkg_resources.EGG_DIST + 1
warnings.filterwarnings(
'ignore', '.+is being parsed as a legacy, non PEP 440, version')
......@@ -426,9 +428,10 @@ class Installer:
return None
# Filter the available dists for the requirement and source flag
wheel = getattr(requirement, 'wheel', False)
dists = [dist for dist in index[requirement.project_name]
if ((dist in requirement)
and
and (dist.precedence == WHL_DIST) == wheel and
((not source) or
(dist.precedence == pkg_resources.SOURCE_DIST)
)
......@@ -621,6 +624,9 @@ class Installer:
"""Return requirement with optional [versions] constraint added."""
constraint = self._versions.get(requirement.project_name.lower())
if constraint:
wheel = constraint.endswith(':whl')
if wheel:
constraint = constraint[:-4]
try:
requirement = _constrained_requirement(constraint,
requirement)
......@@ -628,6 +634,8 @@ class Installer:
logger.info(self._version_conflict_information(
requirement.project_name.lower()))
raise
if wheel:
requirement.wheel = True
return requirement
......
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