-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preliminary manylinux2 support. #5008
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Implement manylinux2 platform tag support. manylinux2 is the successor | ||
to manylinux1. It allows carefully compiled binary wheels to be installed | ||
on compatible Linux platforms. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,6 +157,23 @@ def is_manylinux1_compatible(): | |
return pip._internal.utils.glibc.have_compatible_glibc(2, 5) | ||
|
||
|
||
def is_manylinux2_compatible(): | ||
# Only Linux, and only x86-64 / i686 | ||
if get_platform() not in {"linux_x86_64", "linux_i686"}: | ||
return False | ||
|
||
# Check for presence of _manylinux module | ||
try: | ||
import _manylinux | ||
return bool(_manylinux.manylinux2_compatible) | ||
except (ImportError, AttributeError): | ||
# Fall through to heuristic check below | ||
pass | ||
|
||
# Check glibc version. CentOS 6 uses glibc 2.12. | ||
return pip._internal.utils.glibc.have_compatible_glibc(2, 12) | ||
|
||
|
||
def get_darwin_arches(major, minor, machine): | ||
"""Return a list of supported arches (including group arches) for | ||
the given major, minor and machine architecture of an macOS machine. | ||
|
@@ -276,8 +293,16 @@ def get_supported(versions=None, noarch=False, platform=None, | |
else: | ||
# arch pattern didn't match (?!) | ||
arches = [arch] | ||
elif platform is None and is_manylinux1_compatible(): | ||
arches = [arch.replace('linux', 'manylinux1'), arch] | ||
elif arch.startswith('manylinux2'): | ||
# manylinux1 wheels run on manylinux2 systems. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given the removal of ncurses 5 from the ABI requirement, this implication isn't necessarily true: it's possible for a platform to be compatible with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In practice pip's heuristics for deciding whether a platform is compatible with manylinux1 and manylinux2010 don't actually do any checking of ncurses. I suppose it's possible for someone to provide a The branch below that just calls There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @njsmith The As for how this branch can be reached, it's only when So I think the best way to start out will be with a strict interpretation of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wtolson pointed out that the PEP explicitly calls for I don't think it's worth going back and amending the PEP at this point, so let's just keep the branch, and add a reference to that part of the PEP in a comment. |
||
arches = [arch, arch.replace('manylinux2', 'manylinux1')] | ||
elif platform is None: | ||
arches = [] | ||
if is_manylinux2_compatible(): | ||
arches.append(arch.replace('linux', 'manylinux2')) | ||
if is_manylinux1_compatible(): | ||
arches.append(arch.replace('linux', 'manylinux1')) | ||
arches.append(arch) | ||
else: | ||
arches = [arch] | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I feel like this is probably a bit of footgun. It feels like the kind of thing that's asking to be a bug once we have a
manylinux2018
or something.