Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using distutils in python module #10251

Closed
rubenrua opened this issue Apr 8, 2022 · 3 comments
Closed

Stop using distutils in python module #10251

rubenrua opened this issue Apr 8, 2022 · 3 comments

Comments

@rubenrua
Copy link

rubenrua commented Apr 8, 2022

Describe the bug
The python module uses distutils inside the INTROSPECT_COMMAND. But distutils is deprecated with removal planned for Python 3.12. (See the What’s New entry for more information).

To Reproduce
Use the meson Python module with Python 3.12

Expected behavior
Keep working.

A solution could be using sysconfig.get_paths. But maybe keep using distutils for old versions of Python it is necessary.

@eli-schwartz
Copy link
Member

Duplicate of #7702

@eli-schwartz eli-schwartz marked this as a duplicate of #7702 Apr 8, 2022
@eli-schwartz
Copy link
Member

eli-schwartz commented Apr 8, 2022

Note that we already use sysconfig to get path information.

As discussed in the linked ticket, distutils is only used:

  • on Debian to discover information that debian goes against upstream Python with, because that information is NOT available in sysconfig despite that upstream Python would like them to add it
  • discovering whether an extension module is supposed to link to libpython (dll requirement, elf DT_NEEDED) which is NOT available in sysconfig last I checked, and varies by both python version and OS

Both of these are unsolvable even in python 3.11 nightly, for different reasons.

@rubenrua
Copy link
Author

rubenrua commented Apr 8, 2022

Thank you for the information

FYI the 3.10 version of python in debian and ubuntu has changed its installation scheme from 'posix_prefix' to the debian-specific 'posix_local'. I think 'sysconfig.get_paths()' can be used with that version.

More info https://bugs.launchpad.net/ubuntu/+source/python3.10/+bug/1967920

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants