diff --git a/pep-0571.rst b/pep-0571.rst index 5a610e4bc..3dd955056 100644 --- a/pep-0571.rst +++ b/pep-0571.rst @@ -261,6 +261,31 @@ the ``_manylinux`` module described in PEP 513. A platform is considered incompatible with ``manylinux2010`` if the attribute is ``False``. +If the ``_manylinux`` module is not found, or it does not have the attribute +``manylinux2010_compatible``, tools may fall back to checking for glibc. If the +platform has glibc 2.12 or newer, it is assumed to be compatible unless the +``_manylinux`` module says otherwise. + +Specifically, the algorithm we propose is:: + + def is_manylinux2010_compatible(): + # Only Linux, and only x86-64 / i686 + from distutils.util import get_platform + if get_platform() not in ["linux-x86_64", "linux-i686"]: + return False + + # Check for presence of _manylinux module + try: + import _manylinux + return bool(_manylinux.manylinux2010_compatible) + except (ImportError, AttributeError): + # Fall through to heuristic check below + pass + + # Check glibc version. CentOS 6 uses glibc 2.12. + # PEP 513 contains an implementation of this function. + return have_compatible_glibc(2, 12) + Backwards compatibility with ``manylinux1`` wheels ==================================================