Skip to content

Commit

Permalink
change how environment variables are being read in
Browse files Browse the repository at this point in the history
  • Loading branch information
rsln-s committed Aug 5, 2024
1 parent 27a9b4d commit 3ffe5b1
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"

Expand All @@ -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:
Expand All @@ -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 {}),

0 comments on commit 3ffe5b1

Please sign in to comment.