On Tue, Oct 18, 2022 at 10:53:12AM +0100, Richard W.M. Jones wrote:
Actually some help for how to replace it would be useful too as
sysconfig is not an exact replacement for distutils.sysconfig. In
particular get_python_lib doesn't exist, and I can't find an exact
replacement.
Original code:
$ python3 -c 'import distutils.sysconfig;
print(distutils.sysconfig.get_python_lib(1,0));'
/usr/lib64/python3.11/site-packages
Potential replacement:
$ python3 -c 'import sysconfig;
print(sysconfig.get_path("platlib"));'
/usr/local/lib64/python3.11/site-packages
Maybe the original code was wrong, but I guess we don't want to
install site packages in /usr/local when running under RPM at least.
Note it's used here:
https://github.com/libguestfs/libguestfs/blob/master/python/Makefile.am#L...
(We do not -- and cannot -- use ordinary Python install mechanisms.)
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit