Skip to content
Snippets Groups Projects
Commit 9d7418c1 authored by Ashwin Kumar Karnad's avatar Ashwin Kumar Karnad
Browse files

update help for the toolchain argument

parent 0a516e8f
No related branches found
No related tags found
2 merge requests!19Move linux-debian11 into main,!1Resolve "First draft for user interface for top level install command"
......@@ -26,10 +26,11 @@ config_vars = {
# Helper class to change directory via context manager
class os_chdir:
"""
The os_chdir class is a context manager that
changes the current directory to a specified directory
The os_chdir class is a context manager that
changes the current directory to a specified directory
and returns to the original directory after execution.
"""
def __init__(self, new_dir):
self.new_dir = new_dir
self.saved_dir = os.getcwd()
......@@ -83,7 +84,9 @@ def setup_log_cmd(mpsd_release: str, script_dir: str, msg: str = None, *args, **
.strip()
)
script_commit_hash = (
subprocess.run(["git", "rev-parse", "--short", "HEAD"], stdout=subprocess.PIPE).stdout.decode().strip()
subprocess.run(["git", "rev-parse", "--short", "HEAD"], stdout=subprocess.PIPE)
.stdout.decode()
.strip()
)
# spack-environments branch and commit hash from kwargs
spe_branch = kwargs.get("spe_branch", None)
......@@ -97,7 +100,7 @@ def setup_log_cmd(mpsd_release: str, script_dir: str, msg: str = None, *args, **
def create_dir_structure(mpsd_release: str, script_dir: Path) -> None:
"""
The create_dir_structure function creates the directory structure for the specified release
The create_dir_structure function creates the directory structure for the specified release
and clones the Spack environments repository if it doesn't exist.
Args:
......@@ -185,8 +188,13 @@ def prepare_environment(mpsd_release: str, script_dir: Path) -> List[str]:
return available_toolchains
def install_environment(mpsd_release: str, toolchains: List[str], script_dir: Path, force_reinstall: bool = False,
enable_build_cache: bool = False) -> None:
def install_environment(
mpsd_release: str,
toolchains: List[str],
script_dir: Path,
force_reinstall: bool = False,
enable_build_cache: bool = False,
) -> None:
"""
Installs the specified MPSD release and toolchains to the specified directory using Spack.
......@@ -223,7 +231,9 @@ def install_environment(mpsd_release: str, toolchains: List[str], script_dir: Pa
toolchains = available_toolchains
elif toolchains == "NONE":
# No toolchains requested, so we only create the env and print the list of available toolchains
print(f"No toolchains requested. Available toolchains for release {mpsd_release} are: \n {available_toolchains}")
print(
f"No toolchains requested. Available toolchains for release {mpsd_release} are: \n {available_toolchains}"
)
return
for toolchain in toolchains:
......@@ -293,7 +303,7 @@ def main():
type=str,
nargs="+",
default="NONE",
help="List of toolchains to install (use ALL to install all toolchains)",
help="List of toolchains to install (use ALL to install all toolchains). If nothing is specified, list of available toolchains for the release would be shown after creating the environment.",
)
subp.add_argument(
"--enable-build-cache",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment