Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update setup.py #59253

Merged
merged 3 commits into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,24 @@
f"you are using Python {python_version}"
)
elif env_version is None:
print(f"export PY_VERSION = { python_version }")
print(f"Export PY_VERSION = { python_version }")
os.environ["PY_VERSION"] = python_version

elif env_version != version:
warnings.warn(
f"You set PY_VERSION={env_version}, but "
f"your current python environment is {version} "
f"we will use your current python version to execute."
f"we will attempt to use the python version you set to execute."
)
os.environ["PY_VERSION"] = python_version
cmd = 'which python' + env_version
res = subprocess.run(cmd, shell = True, stdout=subprocess.PIPE)
if res.returncode == 0:
os.environ["PYTHON_EXECUTABLE"] = res
else:
raise RuntimeError(
"We can't find the version you set in your machine"
)


# check cmake
CMAKE = shutil.which('cmake3') or shutil.which('cmake')
Expand Down