fix: python bindings: use stdlib distutils when setuptools is installed
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 15 Jun 2023 17:29:54 +0000 (13:29 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 18 Oct 2023 04:45:23 +0000 (00:45 -0400)
commitcb50b38fd0c51b3b0c650b2437cbba572321d53a
treed90cb1368c3f869edbd359ccd472a0319eceb550
parentd617eb920ca0200db3fee1674c7002d5ace084ba
fix: python bindings: use stdlib distutils when setuptools is installed

When the setuptools package is installed, it monkey patches the standard
library distutils even if the user code doesn't import setuptools.

This results in a failure to install the Python agent in a directory
which isn't in the current PYTHONPATH. To allow this, setuptools requires
the '--single-version-externally-managed' options which is not
implemented in distutils.

To resolve this, force the use of distutils for Python < 3.12 even when
setuptools is installed with the 'SETUPTOOLS_USE_DISTUTILS' environment
variable and use the previously mentionned setuptools option with Python
>= 3.12 which doesn't include distutils anymore.

Change-Id: I9e8412021c6ec79b0a9ea38759c475113e4ea018
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10371
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
.gitignore
configure.ac
src/bindings/python/bt2/Makefile.am
This page took 0.025215 seconds and 4 git commands to generate.