|
1 |
| -# Logic copied from PEP 513 |
| 1 | +# Logic copied from PEP 599 |
2 | 2 |
|
3 | 3 | import sys
|
4 | 4 |
|
5 | 5 |
|
6 |
| -def is_manylinux2010_compatible(): |
7 |
| - # Only Linux, and only x86-64 / i686 |
| 6 | +def is_manylinux2014_compatible(): |
| 7 | + # Only Linux, and only supported architectures |
8 | 8 | from distutils.util import get_platform
|
9 |
| - if get_platform() not in ["linux-x86_64", "linux-i686"]: |
| 9 | + if get_platform() not in [ |
| 10 | + "linux-x86_64", |
| 11 | + "linux-i686", |
| 12 | + "linux-aarch64", |
| 13 | + "linux-armv7l", |
| 14 | + "linux-ppc64", |
| 15 | + "linux-ppc64le", |
| 16 | + "linux-s390x", |
| 17 | + ]: |
10 | 18 | return False
|
11 | 19 |
|
12 | 20 | # Check for presence of _manylinux module
|
13 | 21 | try:
|
14 | 22 | import _manylinux
|
15 |
| - return bool(_manylinux.manylinux1_compatible) |
| 23 | + return bool(_manylinux.manylinux2014_compatible) |
16 | 24 | except (ImportError, AttributeError):
|
17 | 25 | # Fall through to heuristic check below
|
18 | 26 | pass
|
19 | 27 |
|
20 |
| - # Check glibc version. CentOS 6 uses glibc 2.12. |
21 |
| - return have_compatible_glibc(2, 12) |
| 28 | + # Check glibc version. CentOS 7 uses glibc 2.17. |
| 29 | + # PEP 513 contains an implementation of this function. |
| 30 | + return have_compatible_glibc(2, 17) |
22 | 31 |
|
23 | 32 |
|
24 | 33 | def have_compatible_glibc(major, minimum_minor):
|
@@ -49,9 +58,9 @@ def have_compatible_glibc(major, minimum_minor):
|
49 | 58 | return True
|
50 | 59 |
|
51 | 60 |
|
52 |
| -if is_manylinux2010_compatible(): |
53 |
| - print("%s is manylinux2010 compatible" % (sys.executable,)) |
| 61 | +if is_manylinux2014_compatible(): |
| 62 | + print("%s is manylinux2014 compatible" % (sys.executable,)) |
54 | 63 | sys.exit(0)
|
55 | 64 | else:
|
56 |
| - print("%s is NOT manylinux2010 compatible" % (sys.executable,)) |
| 65 | + print("%s is NOT manylinux2014 compatible" % (sys.executable,)) |
57 | 66 | sys.exit(1)
|
0 commit comments