[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-gpio
Subject:    [libgpiod][PATCH 10/11] bindings: python: fix the GPIOD_WITH_TESTS build flag
From:       Bartosz Golaszewski <brgl () bgdev ! pl>
Date:       2022-11-30 12:42:30
Message-ID: 20221130124231.1054001-11-brgl () bgdev ! pl
[Download RAW message or body]

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Currently in order to disable test the variable needs to be explicitly
set to GPIOD_WITH_TESTS= in the environment or setup.py will crash.

Assume tests should not be built if the variable is not set at all.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 bindings/python/setup.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bindings/python/setup.py b/bindings/python/setup.py
index 2a8481c..c90d7d7 100644
--- a/bindings/python/setup.py
+++ b/bindings/python/setup.py
@@ -28,8 +28,7 @@ gpiosim_ext = Extension(
 )
 
 extensions = [gpiod_ext]
-with_tests = bool(environ["GPIOD_WITH_TESTS"])
-if with_tests:
+if "GPIOD_WITH_TESTS" in environ and environ["GPIOD_WITH_TESTS"] == "1":
     extensions.append(gpiosim_ext)
 
 with open("gpiod/version.py", "r") as fd:
-- 
2.37.2

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic