As distutils
is being removed from Python in the > 3.10 versions, and setuptools will not be added to the stdlib, I want to replace an existing setup.py
recipe for building/installing a C++ library Cython extension (i.e. not primarily a Python package, not run in a venv, etc.) with some custom code.
The Cython part is working fine, and I just about managed to construct an equivalent call to the C++ compiler from that previously executed by distutils
, by using config-var info from sysconfig
... though the latter was very trial and error, with no documentation or particular consistency to the config-var collection as far as I could tell.
But I am now stuck on identifying what directory to install my build extension .so
into, within the target prefix
of my build. Depending on the platform and path scheme in use, and the prefix itself, the subdirs could be in lib
or lib64
, a pythonX.Y
subdir of some sort, and a final site-packages
, dist-packages
or other directory. This decision was previously made by distutils
but I can't find any equivalent code to return such path decisions in other stdlib packages.
Any suggestions of answers or best-practice approaches? (Other than "use setuptools", please!)