From 3ffe5b1db79cc5c124e2dde94a6c04264a73f68b Mon Sep 17 00:00:00 2001 From: "Shaydulin, Ruslan" Date: Mon, 5 Aug 2024 19:33:35 -0400 Subject: [PATCH] change how environment variables are being read in --- setup.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/setup.py b/setup.py index f21f2556d..231d06b9b 100644 --- a/setup.py +++ b/setup.py @@ -9,15 +9,7 @@ import sys -environment_variable_name = "QOKIT_NO_C_ENV" -# QOKIT_PYTHON_ONLY = False -QOKIT_NO_C_ENV = False # used for tests only - -environment_variable_value = os.environ.get(environment_variable_name, None) -QOKIT_PYTHON_ONLY = os.environ.get("QOKIT_PYTHON_ONLY", False) - -if environment_variable_value is not None: - QOKIT_NO_C_ENV = True +QOKIT_PYTHON_ONLY = os.environ.get("QOKIT_PYTHON_ONLY") == "true" path = "./qokit/fur/c/csim/src/" @@ -34,8 +26,6 @@ class SimulatorBuild(build_ext): def run(self): try: if not QOKIT_PYTHON_ONLY: - if QOKIT_NO_C_ENV: - raise Exception("No C/C++ enviroment setup") subprocess.call(["make", "-C", path]) super().run except Exception as e: @@ -45,5 +35,4 @@ def run(self): with open("README.md", "r") as f: long_description = f.read() - setup(ext_modules=extensions, cmdclass={"build_ext": SimulatorBuild} if sys.platform == "win32" else {}),