diff options
author | Nate Coraor <nate@bx.psu.edu> | 2016-03-04 11:13:05 -0500 |
---|---|---|
committer | Nate Coraor <nate@bx.psu.edu> | 2016-03-04 11:13:05 -0500 |
commit | 80a06d58f7e5fbf2cc54ec3dbc3f90f188d58bcb (patch) | |
tree | 0fa1c3447cd5a1417d87b496bce8041dee17a60c | |
parent | e9219ad843137bd4336baf0cf8f4c5a593039262 (diff) | |
download | wheel-80a06d58f7e5fbf2cc54ec3dbc3f90f188d58bcb.tar.gz |
Wheels built on a 32 bit interpreter running on 64 bit Linux should carry the
linux_i686 platform tag.
(From pip #3497 and manylinux1)
-rw-r--r-- | wheel/bdist_wheel.py | 9 | ||||
-rw-r--r-- | wheel/pep425tags.py | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/wheel/bdist_wheel.py b/wheel/bdist_wheel.py index 90db748..3dc2caf 100644 --- a/wheel/bdist_wheel.py +++ b/wheel/bdist_wheel.py @@ -11,6 +11,7 @@ import subprocess import warnings import shutil import json +import sys import wheel try: @@ -27,13 +28,12 @@ safe_version = pkg_resources.safe_version from shutil import rmtree from email.generator import Generator -from distutils.util import get_platform from distutils.core import Command from distutils.sysconfig import get_python_version from distutils import log as logger -from .pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag +from .pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag, get_platform from .util import native, open_for_csv from .archive import archive_wheelfile from .pkginfo import read_pkg_info, write_pkg_info @@ -139,8 +139,11 @@ class bdist_wheel(Command): plat_name = 'any' else: plat_name = self.plat_name or get_platform() + if plat_name in ('linux-x86_64', 'linux_x86_64') and sys.maxsize == 2147483647: + plat_name = 'linux_i686' plat_name = plat_name.replace('-', '_').replace('.', '_') + if self.root_is_pure: if self.universal: impl = 'py2.py3' @@ -156,7 +159,7 @@ class bdist_wheel(Command): supported_tags = pep425tags.get_supported( supplied_platform=plat_name if self.plat_name_supplied else None) # XXX switch to this alternate implementation for non-pure: - assert tag == supported_tags[0] + assert tag == supported_tags[0], "%s != %s" % (tag, supported_tags[0]) return tag def get_archive_basename(self): diff --git a/wheel/pep425tags.py b/wheel/pep425tags.py index 106c879..5ac5d0d 100644 --- a/wheel/pep425tags.py +++ b/wheel/pep425tags.py @@ -100,7 +100,11 @@ def get_abi_tag(): def get_platform(): """Return our platform name 'win32', 'linux_x86_64'""" # XXX remove distutils dependency - return distutils.util.get_platform().replace('.', '_').replace('-', '_') + result = distutils.util.get_platform().replace('.', '_').replace('-', '_') + if result == "linux_x86_64" and sys.maxsize == 2147483647: + # pip pull request #3497 + result = "linux_i686" + return result def get_supported(versions=None, supplied_platform=None): |