Use plain "abi3" where supported in pep425tags.get_supported · Issue #7327 · pypa/pip (original) (raw)

What's the problem this feature will solve?

Currently we calculate stable ABI tags dynamically, when it could be static.

Recall that wheel filenames look like:

...-{python tag}-{abi tag}-{platform tag}.whl

The {abi tag} is defined in PEP 425. One specific ABI tag called out is "abi3", which is defined as "the CPython stable ABI".

Instead of just using "abi3", to get the list of stable ABIs in pep425tags.get_supported() we use this:

    for suffix in get_extension_suffixes():
        if suffix.startswith('.abi'):
            abi3s.add(suffix.split('.', 2)[1])

This seems like an attempt to apply PEP 3149 to wheel ABI tags, but seems like overkill given the only defined stable ABI is "abi3".

It would be simpler to integrate with the current packaging.tags if we just assume "abi3" is the only possible value and is available only on CPython 3.2+.

Describe the solution you'd like

if sys.implementation.name == "cpython" and sys.version_info >= (3, 2):
    abi3s.add("abi3")

or something simpler since this will only ever be the single value.

Alternative Solutions

Additional context