[libgpiod][PATCH] bindings: python: relax the verbosity adjustment in build_tests.sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

When building tests using the build_tests.py script, we try to increase
the verbosity using setuptools.logging.configure() preferably but
falling back to distutils.log.set_verbosity() if the former is missing.

This however creates a hard dependency on distutils on older environments
missing the recently added setuptools method. The build however, can work
fine even with default (low) verbosity so instead of bailing out if the
second import fails, just keep going.

Closes: https://github.com/brgl/libgpiod/issues/109
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
---
 bindings/python/build_tests.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bindings/python/build_tests.py b/bindings/python/build_tests.py
index 84cedfc..ebe1727 100644
--- a/bindings/python/build_tests.py
+++ b/bindings/python/build_tests.py
@@ -82,9 +82,13 @@ try:
 
     configure()
 except ImportError:
-    from distutils.log import DEBUG, set_verbosity
+    try:
+        from distutils.log import DEBUG, set_verbosity
 
-    set_verbosity(DEBUG)
+        set_verbosity(DEBUG)
+    except ImportError:
+        # We can still build the tests, it will just be very quiet.
+        pass
 
 with tempfile.TemporaryDirectory(prefix="libgpiod-") as temp_dir:
     command = build_ext(dist)
-- 
2.45.2





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux