How to compute installation filenames

For example, “include/python3.10/”. sysconfig lets you query for many of these paths, but not all of them, so some projects (including distutils) will compute some of the paths themselves.

The issue is that there is a current assumption that the path name is "python%d.%d" % sys.version_info[:2], because this is true in CPython (and PyPy tends to have special-case handling in packaging projects). But alternative implementations have to pick other names in order to coexist with CPython on the same system, so for example the Pyston project naming is currently “include/python3.8-pyston2.3/”.

So the question is, what should the convention be for determining the names of these paths if we’d like to support alternate implementations?

The second-most common way of computing the path we’ve seen is "python" + sysconfig.get_config_var("VERSION"), which is more general and supports alternative implementations. Because we’ve seen this already in the wild I’m personally in favor of this particular answer, but we’d be happy with anything that supports alternative implementations.

This is the issue I’m trying to address in Use the VERSION variable instead of recalculating it by kmod · Pull Request #107 · pypa/distutils · GitHub , where you can see how this can crop up and my proposal for how to address it.