Packaging support for PEP 652

PEP 652 was recently accepted.

In its discussion I didn’t see any mention of pip or pypi. However, given the PEP I’m hoping pip could use that to support installing older wheels that are marked as using only the limited API for newer python versions.

I’m assuming that it would require some modification to pip and pypi and possibly wheel metadata. But ultimately it would be nice if I could somehow compile a wheel for 3.x using e.g. cython or your own extension and mark it as using only the limited API, and then when installing the package for 3.x+1, pip would install it if there’s no wheel for 3.x+1 on pypi.

I’m guessing this would require a larger discussion than just pip, that’s why I didn’t open a request on the pip repo, but has anyone considered this?

If I understand correctly, PEP 652 is simply codifying abi3, which pip has supported for years. The problem was never pip, but that the ABI itself was ill-defined and used by nearly nobody. Now it is no longer difficult to use, wheels can simply use the abi3 ABI tag and should just work.

4 Likes

To confirm this, if you have a modern-enough pip, you can do:

$ pip debug --verbose

This should print a list of tags in its output, some of which will be abi3 based.

(the reason for needing a modern-enough pip is that pip debug was added relatively recently)

1 Like