The platform tag in PEP 425 is defined as being the value of
distutils.util.get_platform(). Given that there is work ongoing to remove
distutils from the standard library, we should think about updating the PEP to not rely on distutils.
I assume the best option would be to copy the implementation from
packaging and update the PEP to link to
packaging. Documenting the algorithm in the PEP isn’t really practical, as it’s pretty complicated.
- I’m discounting the option of getting the information from setuptools - making everyone that wants to use tags take a dependency on setuptools seems unreasonable.
- This is likely to force the issue of the wheel project needing a dependency on packaging, as the stdlib will no longer have a way of getting the platform tag for a wheel.
- It’s not impossible that the “remove distutils” PEP could be updated to allow for moving
get_platform()to elsewhere in the stdlib. I’ve not explored that possibility.
- This is not an immediate issue. The plan for removal of distutils is in very early stages yet - it won’t happen before Python 3.12 at the absolute earliest. But it’s probably a good idea to think about this anyway, having the standard rely on distutils, which is unmaintained, is not ideal.
It’s possible I’ve missed something here. Linux has manylinux, and MacOS seems to have multiple “platforms” at once, and I don’t really know how they fit in with the above. Windows is pretty trivial in comparison. Maybe an alternative would be to simply specify replacement rules that don’t use distutils at all? I’d love someone who understands the subject better than me to comment on whether the distutils complexity is even relevant any more.
(As I said above, there’s no rush on this. But I wanted to record the issue now, before I forget about it).