Filter out binary Wheels for non Windows

This commit is contained in:
Donald Stufft 2013-06-28 19:36:41 -04:00
parent be1f752e8b
commit 899d48021b
1 changed files with 20 additions and 0 deletions

View File

@ -466,6 +466,26 @@ class PackageFinder(object):
if not link.wheel.supported():
logger.debug('Skipping %s because it is not compatible with this Python' % link)
return []
# This is a dirty hack to prevent installing Binary Wheels from
# PyPI or one of it's mirrors unless it is a Windows Binary
# Wheel. This is paired with a change to PyPI disabling
# uploads for the same. Once we have a mechanism for enabling
# support for binary wheels on linux that deals with the
# inherent problems of binary distribution this can be
# removed.
comes_from = getattr(link, "comes_from", None)
if (comes_from is not None
and urlparse(comes_from.url).netloc.endswith(
"pypi.python.org")):
bsupport = set(["any", "win32", "win-amd64", "win-ia64"])
if set(link.wheel.plats) - bsupport:
logger.debug(
"Skipping %s because it is a binary Wheel on an "
"unsupported platform" % link
)
return []
if not version:
version = self._egg_info_matches(egg_info, search_name, link)
if version is None: