Skip to content

Commit

Permalink
[SCons] Fix python_prefix/prefix handling for minimal Python module
Browse files Browse the repository at this point in the history
Make the case where prefix is specified but python_prefix is not consistent
with how the full Python module is handled.

Fix a case where the minimal Python module could be installed to a directory
named literally 'python_prefix'.
speth committed Apr 10, 2022
1 parent 0d29d6a commit 903c184
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions interfaces/python_minimal/SConscript
Original file line number Diff line number Diff line change
@@ -32,17 +32,19 @@ localenv.Depends(mod, [make_setup, readme, license, "setup.py", "pyproject.toml"
install_cmd = ["$python_cmd_esc", "-m", "pip", "install"]
user_install = False
python_prefix = None
python_root = None
if localenv["PYTHON_INSTALLER"] == "direct":
if localenv["python_prefix"] == "USER":
# Install to the OS-dependent user site-packages directory
install_cmd.append("--user")
user_install = True
elif localenv["python_prefix"]:
# A specific location for the Cantera python module has been given
install_cmd.extend((f"--prefix={localenv.subst('python_prefix')}",
install_cmd.extend((f"--prefix={localenv.subst('$python_prefix')}",
"--no-warn-script-location"))
python_prefix = localenv.subst("python_prefix")
python_prefix = localenv.subst("$python_prefix")
elif not env["default_prefix"]:
install_cmd.append(f"--prefix={env['prefix']}")
python_prefix = env["prefix"]

if env["stage_dir"]:
# Get the absolute path to the stage directory. If the stage directory is a relative

0 comments on commit 903c184

Please sign in to comment.