Don't cache wheels for links which do not point to release artifacts

This commit is contained in:
Donald Stufft 2015-05-22 17:13:07 -04:00
parent 28e94c7a2e
commit fc5746a34c
2 changed files with 17 additions and 0 deletions

View File

@ -1207,6 +1207,19 @@ class Link(object):
def is_wheel(self):
return self.ext == wheel_ext
@property
def is_artifact(self):
"""
Determines if this points to an actual artifact (e.g. a tarball) or if
it points to an "abstract" thing like a path or a VCS location.
"""
from pip.vcs import vcs
if self.scheme in vcs.all_schemes:
return False
return True
# An object to represent the "link" for the installed version of a requirement.
# Using Inf as the url makes it sort higher.

View File

@ -110,6 +110,8 @@ def cached_wheel(cache_dir, link, format_control, package_name):
return link
if link.is_wheel:
return link
if not link.is_artifact:
return link
if not package_name:
return link
canonical_name = pkg_resources.safe_name(package_name).lower()
@ -714,6 +716,8 @@ class WheelBuilder(object):
logger.info(
'Skipping bdist_wheel for %s, due to being editable',
req.name)
elif autobuilding and not req.link.is_artifact:
pass
elif autobuilding and not req.source_dir:
pass
else: