diff mbox series

[libgpiod] bindings: python: drop distutils from build_tests.py

Message ID 20241119145951.126841-1-brgl@bgdev.pl
State New
Headers show
Series [libgpiod] bindings: python: drop distutils from build_tests.py | expand

Commit Message

Bartosz Golaszewski Nov. 19, 2024, 2:59 p.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

The configure() function in setuptools.logging has been available since
v61.0.0 release so for over 2,5 years. We can generally expect users of
python bindings to be using relatively recent versions of required
dependencies. At the same time distutils has long been deprecated.

Let's keep the try: guard for setuptools.logging.configure but instead
of importing distutils if the former is unavailable, just do nothing and
drop the deprecated import altogether.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 bindings/python/build_tests.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/bindings/python/build_tests.py b/bindings/python/build_tests.py
index 1760257..bfdc4c0 100644
--- a/bindings/python/build_tests.py
+++ b/bindings/python/build_tests.py
@@ -2,8 +2,8 @@ 
 # SPDX-FileCopyrightText: 2023 Phil Howard <phil@gadgetoid.com>
 
 """
-Bring up just enough of setuptools/distutils in order to build the gpiod
-test module C extensions.
+Bring up just enough of setuptools in order to build the gpiod test
+module C extensions.
 
 Set "build_temp" and "build_lib" so that our source directory is not
 polluted with artefacts in build/
@@ -81,10 +81,8 @@  try:
     from setuptools.logging import configure
 
     configure()
-except ImportError:
-    from distutils.log import DEBUG, set_verbosity
-
-    set_verbosity(DEBUG)
+except:
+    pass
 
 with tempfile.TemporaryDirectory(prefix="libgpiod-") as temp_dir:
     command = build_ext(dist)