Skip to content
Snippets Groups Projects
Commit 7e61d228 authored by Matthew Fernandez's avatar Matthew Fernandez
Browse files

Autotools: use 'sysconfig' to discover Python module installation path

Python 3.10 deprecated the `distutils` module. Python 3.12 will remove it
altogether.

This change replaces the use of `distutils.syconfig` with its documented
replacement. Note that this is not entirely equivalent, seemingly due to distro
patches. For example:

  On Ubuntu 22.04 with Python 3.10:
    >>> distutils.sysconfig.get_python_lib(1, 0)
    '/usr/lib/python3/dist-packages'
    >>> sysconfig.get_path("platlib")
    '/usr/local/lib/python3.10/dist-packages'

  On Fedora 37 with Python 3.11:
    >>> distutils.sysconfig.get_python_lib(1, 0)
    '/usr/lib64/python3.11/site-packages'
    >>> sysconfig.get_path("platlib")
    '/usr/local/lib64/python3.11/site-packages'

It seems the `sysconfig` paths, though not equivalent, are actually the correct
ones that Graphviz should be using.

Gitlab: fixes #2332
Reported-by: Tom Callaway
parent c9d23fda
No related branches found
No related tags found
Loading
Pipeline #818348330 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment