mirror of https://github.com/pypa/pip
Filter out binary Wheels for non Windows
This commit is contained in:
parent
be1f752e8b
commit
899d48021b
20
pip/index.py
20
pip/index.py
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue