[Distutils] PEP 513: A Platform Tag for Portable Linux Built Distributions Version

Nathaniel Smith njs at pobox.com
Tue Jan 26 18:41:55 EST 2016


Hi Xavier,

On Tue, Jan 26, 2016 at 3:03 PM, Xavier Fernandez
<xav.fernandez at gmail.com> wrote:
> Hello,
>
> The site.py solution seems appropriate but I'd be more in favor of a
> `sys.supported_platform_tags =['manylinux1']` attribute, with an order of
> preferences to ease the wheel selection when several such tags will be
> added.

I talked a little about this here:
    https://mail.python.org/pipermail/distutils-sig/2016-January/028049.html

Basically my only concern is that we want some way to distinguish
between three states: "this interpreter definitely supports
manylinux1", "this interpreter definitely doesn't support manylinux1",
and "we don't know whether this interpreter supports manylinux1" (and
pip should fall back on the heuristics described in the PEP). The most
straightforward way of implementing your suggestion would be to check

    "manylinux1" in sys.supported_platform_tags

but this only gives us two possible outcomes. If it's not in there,
then we don't know whether that's because it's known not to work, or
because it's been left unspecified. (And similar issues will
presumably arise in the future for manylinux2, etc.)

I guess a simple extension would be:

    sys.supported_platform_tags = ["manylinux2_x86_64"]
    sys.unsupported_platform_tags = set(["manylinux1_x86_64"])

where the former gives a preferred ordering on known-supported tags,
and the latter gives a set of tags that definitely don't work, and for
any tags that aren't mentioned in either place then pip gets to figure
out for itself what it wants to do. Of course this still leaves the
problem of deciding where in the preference ordering these implicit
tags should be placed...

All this may be a bit over-engineered / YAGNI for now, given that for
now the exhaustive set of platform tags and their preference ordering
will be

  manylinux1_x86_64 > linux_x86_64

(or ditto for i386). :-)

-n

-- 
Nathaniel J. Smith -- https://vorpus.org


More information about the Distutils-SIG mailing list