From a9c5da5bd566698bdff2278f214f0ad662b54cfd Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 14 Jun 2023 15:44:48 +0200
Subject: [PATCH 01/10] reviewed first function (toolchain -> package_set)

---
 mpsd-software.py | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/mpsd-software.py b/mpsd-software.py
index 59284cb..54aaf97 100755
--- a/mpsd-software.py
+++ b/mpsd-software.py
@@ -89,15 +89,15 @@ def create_log_file_names(
     microarch: str,
     action: str,
     date: str = call_date_iso,
-    toolchain: str = None,
+    package_set: str = None,
 ) -> Union[str, None]:
     """Create log file names.
 
     This function creates the log file names for either the installer or
     the build log files.
 
-    If a toolchain is given, then the build log file name is created.
-    if no toolchain is given, then the installer log file name is created.
+    If a package_set is given, then the build log file name is created.
+    if no package_set is given, then the installer log file name is created.
     The installer log file hosts the logs of the installer script, while
     the build log file hosts the logs of the build process as generated by the
     spack_setup.sh script.
@@ -113,8 +113,8 @@ def create_log_file_names(
     action : str
         action performed (install,remove,reinstall,prepare,status)
         only install and remove are valid for build log file.
-    toolchain : str
-        toolchain name (only for build log file)
+    package_set : str
+        package_set name (only for build log file)
 
     Returns
     -------
@@ -125,16 +125,16 @@ def create_log_file_names(
         If the action is not one that changes the files on disk ( info only actions)
         then None is returned.
     """
-    if toolchain:
-        # if toolchain is given, then  we build the build_log_file_name
+    if package_set:
+        # if package_set is given, then  we build the build_log_file_name
         if action in ["install", "remove"]:
             log_file_name = (
-                f"{mpsd_release}_{microarch}_{date}_BUILD_{toolchain}_{action}.log"
+                f"{mpsd_release}_{microarch}_{date}_BUILD_{package_set}_{action}.log"
             )
         else:
             return None
     else:
-        # if toolchain is not given, then we build the installer_log_file_name
+        # if package_set is not given, then we build the installer_log_file_name
         log_file_name = f"{mpsd_release}_{microarch}_{date}_APEX_{action}.log"
 
     return log_file_name
@@ -266,7 +266,7 @@ def set_up_logging(loglevel="warning", file_path=None):
 
        Typical and intended use:
 
-       print_log.info("Available toolchains are ...")
+       print_log.info("Available package_sets are ...")
 
        The major difference from the normal print command is that the output
        will be send to the stdout (as for print) AND the file with name
-- 
GitLab


From 0686f42074a955c0d025fa1e206a6956bec44f2b Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 14 Jun 2023 15:51:56 +0200
Subject: [PATCH 02/10] bugfix (to go with last commit)

---
 tests.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests.py b/tests.py
index a050501..4e16f99 100644
--- a/tests.py
+++ b/tests.py
@@ -415,7 +415,7 @@ def test_create_log_file_names():
         mpsd_release=mpsd_release,
         date=date,
         action=action,
-        toolchain=toolchain,
+        package_set=toolchain,
     )
     assert (
         build_log_file_name
@@ -437,7 +437,7 @@ def test_create_log_file_names():
         mpsd_release=mpsd_release,
         date=date,
         action="status",
-        toolchain=toolchain,
+        package_set=toolchain,
     )
     assert build_log_file_name is None
 
-- 
GitLab


From 8009c3e1869a549ed2c41299627aebf34641dcc8 Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 14 Jun 2023 16:04:17 +0200
Subject: [PATCH 03/10] bugfix (another one) for previous commit

---
 mpsd-software.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mpsd-software.py b/mpsd-software.py
index 54aaf97..af47790 100755
--- a/mpsd-software.py
+++ b/mpsd-software.py
@@ -941,7 +941,7 @@ def install_environment(
         for toolchain in toolchains:
             # Set the install log file name from create_log_file_names
             build_log_file_name = create_log_file_names(
-                mpsd_release, microarch, "install", toolchain=toolchain
+                mpsd_release, microarch, "install", package_set=toolchain
             )
             build_log_folder = release_base_dir / "logs"
             build_log_path = build_log_folder / build_log_file_name
-- 
GitLab


From 98bf321caeae768418a28da308c74a3e595b2ba5 Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 14 Jun 2023 16:10:10 +0200
Subject: [PATCH 04/10] more toolchain -> package_set

---
 mpsd-software.py | 32 ++++++++++++++++----------------
 tests.py         |  4 ++--
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/mpsd-software.py b/mpsd-software.py
index af47790..3f14167 100755
--- a/mpsd-software.py
+++ b/mpsd-software.py
@@ -354,8 +354,8 @@ def set_up_logging(loglevel="warning", file_path=None):
     )
 
 
-def get_available_toolchains(mpsd_release: str) -> List[str]:
-    """Given a release, return the available toolchains.
+def get_available_package_sets(mpsd_release: str) -> List[str]:
+    """Given a release, return the available package_sets.
 
     This is based on the spack-environment's repository [1]. For this function
     to succeed, we need to have Internet access etc.
@@ -367,11 +367,11 @@ def get_available_toolchains(mpsd_release: str) -> List[str]:
 
     Returns
     -------
-    toolchains : List[str]
+    package_sets : List[str]
 
     Example
     -------
-    >>> get_available_toolchains('dev-23a')
+    >>> get_available_package_sets('dev-23a')
     ['foss2021a-cuda-mpi',
      'foss2021a-mpi',
      'foss2021a-serial',
@@ -382,36 +382,36 @@ def get_available_toolchains(mpsd_release: str) -> List[str]:
      'global_generic']
 
     """
-    logging.debug(f"get_available_toolchains({mpsd_release=})")
-    logging.info(f"Retrieving available toolchains for release {mpsd_release}")
+    logging.debug(f"get_available_package_sets({mpsd_release=})")
+    logging.info(f"Retrieving available package_sets for release {mpsd_release}")
     print_log = logging.getLogger("print")
 
     # create temporary directory
     tmp_dir = tempfile.TemporaryDirectory(prefix="mpsd-software-available-")
     tmp_dir_path = Path(tmp_dir.name)
 
-    # find toolchains by cloning repository and checking out right branch
+    # find package_sets by cloning repository and checking out right branch
     clone_repo(
         tmp_dir_path, config_vars["spack_environments_repo"], branch=mpsd_release
     )
-    # look for directories defining the toolchains
+    # look for directories defining the package_sets
 
-    toolchains = os.listdir(tmp_dir_path / "toolchains")
-    msg = f"Found toolchains {sorted(toolchains)}"
+    package_sets = os.listdir(tmp_dir_path / "toolchains")
+    msg = f"Found package_sets {sorted(package_sets)}"
     logging.debug(msg)
 
-    # the 'toolchains' split into toolchains (such as foss2022a-mpi) and sets
+    # the 'package_sets' split into toolchains (such as foss2022a-mpi) and sets
     # of packages. Here we split them into the two categories for a more useful
     # output:
     toolchain_list = [
         x.parents[0].name
         for x in list((tmp_dir_path / "toolchains").glob("*/spack.yaml"))
     ]
-    package_sets = [
+    package_set_list = [
         x.parents[0].name for x in list((tmp_dir_path / "toolchains").glob("*/*.list"))
     ]
     logging.debug(f"{toolchain_list=}")
-    logging.debug(f"{package_sets=}")
+    logging.debug(f"{package_set_list=}")
 
     # summarise toolchains found for use, and show packages provided for each
     # package_set:
@@ -420,7 +420,7 @@ def get_available_toolchains(mpsd_release: str) -> List[str]:
     )
     print_log.info("Toolchains: \n    " + "\n    ".join(sorted(toolchain_list)))
     print_log.info("Package sets:")
-    for package_set in package_sets:
+    for package_set in package_set_list:
         # get a list of all packages which
         # starts from the first line of the file
         # that have the regex pattern \w+@\w+
@@ -436,7 +436,7 @@ def get_available_toolchains(mpsd_release: str) -> List[str]:
     # remove temporary directory
     tmp_dir.cleanup()
 
-    return toolchains
+    return package_sets
 
 
 # Helper class to change directory via context manager
@@ -1179,7 +1179,7 @@ def main():
     elif args.action == "prepare":
         prepare_environment(args.release, root_dir)
     elif args.action == "available":
-        get_available_toolchains(args.release)
+        get_available_package_sets(args.release)
     else:
         message = (
             f"No known action found ({args.action=}). Should probably never happen."
diff --git a/tests.py b/tests.py
index 4e16f99..998903d 100644
--- a/tests.py
+++ b/tests.py
@@ -380,13 +380,13 @@ def test_metadata_logging(tmp_path):
     assert len(read_dict) == len(keys)
 
 
-def test_get_available_toolchains():
+def test_get_available_package_sets():
     """
     Test that available toolchains are reported correctly.
 
     Needs internet access to succeed.
     """
-    toolchains = mod.get_available_toolchains("dev-23a")
+    toolchains = mod.get_available_package_sets("dev-23a")
     assert sorted(toolchains) == sorted(
         [
             "foss2021a-cuda-mpi",
-- 
GitLab


From 6a57fac25406e9dfaa17adbf22992256225c74cc Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 14 Jun 2023 16:23:31 +0200
Subject: [PATCH 05/10] more toolchain -> package_set

---
 mpsd-software.py | 68 ++++++++++++++++++++++++------------------------
 tests.py         | 38 +++++++++++++--------------
 2 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/mpsd-software.py b/mpsd-software.py
index 3f14167..2580856 100755
--- a/mpsd-software.py
+++ b/mpsd-software.py
@@ -865,83 +865,83 @@ def get_native_microarchitecture():
 
 def install_environment(
     mpsd_release: str,
-    toolchains: List[str],
+    package_sets: List[str],
     root_dir: Path,
     enable_build_cache: bool = False,
 ) -> None:
     """
-    Install the specified MPSD release and toolchains.
+    Install the specified MPSD release and package_sets.
 
-    The function installs the toolchain to the specified directory, using Spack.
+    The function installs the package_set to the specified directory, using Spack.
 
     Parameters
     ----------
     mpsd_release : str
         A string representing the MPSD release version.
-    toolchains : list of str
-        A list of strings representing the toolchains to install
+    package_sets : list of str
+        A list of strings representing the package_sets to install
         (e.g., "foss2021a-mpi", "global_generic", "ALL").
     root_dir : pathlib.Path
         A Path object representing the path to the directory where
-        the release and toolchains will be installed.
+        the release and package_sets will be installed.
     enable_build_cache : bool, optional
         A boolean indicating whether to build the build cache
-        when installing toolchains. Defaults to False.
+        when installing package_sets. Defaults to False.
 
     Raises
     ------
     ValueError
-        If a requested toolchain is not available in the specified release.
+        If a requested package_set is not available in the specified release.
 
     Returns
     -------
     None
     """
     logging.info(
-        f"Installing release {mpsd_release} with toolchains {toolchains} "
+        f"Installing release {mpsd_release} with package_sets {package_sets} "
         f"to {root_dir}"
     )
 
     # Set required variables
     release_base_dir = root_dir / mpsd_release
     microarch = get_native_microarchitecture()
-    toolchain_dir = release_base_dir / microarch
-    toolchain_dir.mkdir(parents=True, exist_ok=True)
+    package_set_dir = release_base_dir / microarch
+    package_set_dir.mkdir(parents=True, exist_ok=True)
     spack_setup_script = release_base_dir / "spack-environments" / "spack_setup.sh"
     install_flags = []
     if not enable_build_cache:
         install_flags.append("-b")
 
     # run the prepare_environment function
-    available_toolchains = prepare_environment(mpsd_release, root_dir)
-    # Ensure that the requested toolchains are available in the release
-    if toolchains == "ALL":
-        toolchains = available_toolchains
-    elif toolchains == "NONE":
-        # No toolchains requested, so we only create the env and print the
-        # list of available toolchains
+    available_package_sets = prepare_environment(mpsd_release, root_dir)
+    # Ensure that the requested package_sets are available in the release
+    if package_sets == "ALL":
+        package_sets = available_package_sets
+    elif package_sets == "NONE":
+        # No package_sets requested, so we only create the env and print the
+        # list of available package_sets
         logging.warning(
-            "No toolchains requested. Available toolchains for release "
-            f"{mpsd_release} are: \n {available_toolchains}"
+            "No package_sets requested. Available package_sets for release "
+            f"{mpsd_release} are: \n {available_package_sets}"
         )
         print_log = logging.getLogger("print")
-        print_log.info(f"{available_toolchains=}")
+        print_log.info(f"{available_package_sets=}")
         return
 
-    for toolchain in toolchains:
-        if toolchain not in available_toolchains:
-            msg = f"Toolchain '{toolchain}' is not available in release {mpsd_release}."
-            msg += "Use 'available' command to see list of available toolchains."
+    for package_set in package_sets:
+        if package_set not in available_package_sets:
+            msg = f"Package_Set '{package_set}' is not available in release {mpsd_release}."
+            msg += "Use 'available' command to see list of available package_sets."
             logging.error(msg)
             sys.exit(1)
 
-    # Install the toolchains
-    with os_chdir(toolchain_dir):
-        # run spack_setup_script with the toolchains as arguments
-        for toolchain in toolchains:
+    # Install the package_sets
+    with os_chdir(package_set_dir):
+        # run spack_setup_script with the package_sets as arguments
+        for package_set in package_sets:
             # Set the install log file name from create_log_file_names
             build_log_file_name = create_log_file_names(
-                mpsd_release, microarch, "install", package_set=toolchain
+                mpsd_release, microarch, "install", package_set=package_set
             )
             build_log_folder = release_base_dir / "logs"
             build_log_path = build_log_folder / build_log_file_name
@@ -949,24 +949,24 @@ def install_environment(
             if not os.path.exists(build_log_folder):
                 os.makedirs(build_log_folder)
 
-            logging.info(f"Installing toolchain {toolchain} to {toolchain_dir}")
+            logging.info(f"Installing package_set {package_set} to {package_set_dir}")
 
             # log the command
             record_script_execution_summary(
                 mpsd_release,
                 root_dir,
-                msg=f"installing {toolchain} and logging at {build_log_path}",
+                msg=f"installing {package_set} and logging at {build_log_path}",
             )
             record_script_execution_summary(
                 mpsd_release,
                 root_dir,
                 msg=(
                     f"CMD: bash {spack_setup_script} {' '.join(install_flags)} "
-                    f"{toolchain}"
+                    f"{package_set}"
                 ),
             )
             run(
-                f"bash {spack_setup_script} {' '.join(install_flags)} {toolchain} 2>&1 "
+                f"bash {spack_setup_script} {' '.join(install_flags)} {package_set} 2>&1 "
                 f"| tee -a {build_log_path} ",
                 shell=True,
                 check=True,
diff --git a/tests.py b/tests.py
index 998903d..45b15bd 100644
--- a/tests.py
+++ b/tests.py
@@ -193,7 +193,7 @@ def test_install_environment_wrong_toolchain(tmp_path):
     with pytest.raises(Exception):
         mod.install_environment(
             mpsd_release="dev-23a",
-            toolchains=["wrong-toolchain"],
+            package_sets=["wrong-package_set"],
             root_dir=(tmp_path),
         )
 
@@ -205,13 +205,13 @@ def test_install_environment_wrong_mpsd_release(tmp_path):
     with pytest.raises(Exception):
         mod.install_environment(
             mpsd_release="wrong-mpsd-release",
-            toolchains=["foss2021a-mpi"],
+            package_sets=["foss2021a-mpi"],
             root_dir=(tmp_path),
         )
 
 
 def test_install_environment_zlib():
-    """Test installation of toolchain."""
+    """Test installation of package_set."""
     # Prepare a test installation of global generic
     # with only zlib to test the installation
     # This is a long test,
@@ -225,21 +225,21 @@ def test_install_environment_zlib():
         shutil.rmtree(root_dir)
     root_dir.mkdir(exist_ok=True, parents=True)
     mpsd_release_to_test = "dev-23a"
-    toolchain_to_test = "global_generic"
+    package_set_to_test = "global_generic"
     cmd_log_file = mod.config_vars["cmd_log_file"]
     microarch = mod.get_native_microarchitecture()
     release_base_dir = root_dir / mpsd_release_to_test
     create_mock_git_repository(target_directory=root_dir, create_directory=False)
     mod.prepare_environment(mpsd_release=mpsd_release_to_test, root_dir=(root_dir))
     # Patch the spack environments to create a fake global_generic
-    # create a test toolchain
-    toolchain_src_dir = release_base_dir / "spack-environments" / "toolchains"
-    # with mod.os_chdir(toolchain_src_dir):
+    # create a test package_set
+    package_set_src_dir = release_base_dir / "spack-environments" / "toolchains"
+    # with mod.os_chdir(package_set_src_dir):
     #     subprocess.run(
     #         "cp -r foss2021a-mpi fuss1999a", shell=True, capture_output=True
     #     )
     # add zlib as a spec to global_generic
-    with open(toolchain_src_dir / "global_generic" / "global_packages.list", "w") as f:
+    with open(package_set_src_dir / "global_generic" / "global_packages.list", "w") as f:
         f.write("zlib@1.2.13 \n")
 
     # add zlib to whitelist of module creation file by replacing anaconda3%gcc@10.2.1
@@ -269,14 +269,14 @@ def test_install_environment_zlib():
     with open(setup_file, "w") as f:
         f.write(lines)
 
-    # install global_generic toolchain
+    # install global_generic package_set
     mod.set_up_logging(
         "WARNING",
         mod.get_installer_log_file_path(mpsd_release_to_test, "install", root_dir),
     )
     mod.install_environment(
         mpsd_release=mpsd_release_to_test,
-        toolchains=[toolchain_to_test],
+        package_sets=[package_set_to_test],
         root_dir=root_dir,
         enable_build_cache=False,
     )
@@ -308,7 +308,7 @@ def test_install_environment_zlib():
     with open(root_dir / cmd_log_file, "r") as f:
         lines = f.read()
         assert (
-            f"installing {toolchain_to_test} and logging at {str(build_log)}" in lines
+            f"installing {package_set_to_test} and logging at {str(build_log)}" in lines
         )
     # assert that the module files are created correctly
     assert os.path.exists(release_base_dir / microarch)
@@ -329,7 +329,7 @@ def test_install_environment_zlib():
     )
     mod.install_environment(
         mpsd_release=mpsd_release_to_test,
-        toolchains=[toolchain_to_test],
+        package_sets=[package_set_to_test],
         root_dir=root_dir,
         enable_build_cache=False,
     )
@@ -382,12 +382,12 @@ def test_metadata_logging(tmp_path):
 
 def test_get_available_package_sets():
     """
-    Test that available toolchains are reported correctly.
+    Test that available package_sets are reported correctly.
 
     Needs internet access to succeed.
     """
-    toolchains = mod.get_available_package_sets("dev-23a")
-    assert sorted(toolchains) == sorted(
+    package_sets = mod.get_available_package_sets("dev-23a")
+    assert sorted(package_sets) == sorted(
         [
             "foss2021a-cuda-mpi",
             "foss2021a-mpi",
@@ -408,18 +408,18 @@ def test_create_log_file_names():
     microarch = "sandybridge"
     date = datetime.datetime.now().replace(microsecond=0).isoformat()
     action = "install"
-    toolchain = "foss2021a"
+    package_set = "foss2021a"
     # test build_log_file_name  generation
     build_log_file_name = create_log_file_names(
         microarch=microarch,
         mpsd_release=mpsd_release,
         date=date,
         action=action,
-        package_set=toolchain,
+        package_set=package_set,
     )
     assert (
         build_log_file_name
-        == f"{mpsd_release}_{microarch}_{date}_BUILD_{toolchain}_{action}.log"
+        == f"{mpsd_release}_{microarch}_{date}_BUILD_{package_set}_{action}.log"
     )
     installer_log_file_name = create_log_file_names(
         microarch=microarch,
@@ -437,7 +437,7 @@ def test_create_log_file_names():
         mpsd_release=mpsd_release,
         date=date,
         action="status",
-        package_set=toolchain,
+        package_set=package_set,
     )
     assert build_log_file_name is None
 
-- 
GitLab


From a516e1aff0ff07dcecc686b2a76482ec5d2afcbc Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 14 Jun 2023 16:33:35 +0200
Subject: [PATCH 06/10] toolchain -> package_set

---
 mpsd-software.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mpsd-software.py b/mpsd-software.py
index 2580856..bc13d36 100755
--- a/mpsd-software.py
+++ b/mpsd-software.py
@@ -973,9 +973,9 @@ def install_environment(
             )
 
 
-def remove_environment(release, toolchains, target_dir):
+def remove_environment(release, package_sets, target_dir):
     """Remove release from installation."""
-    msg = f"Removing release {release} with toolchains {toolchains} from {target_dir}"
+    msg = f"Removing release {release} with package_sets {package_sets} from {target_dir}"
     logging.info(msg)
     raise NotImplementedError(msg)
 
-- 
GitLab


From b5be8b706ffd67f33edb1196c3cda3f1c3bf5f19 Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 14 Jun 2023 16:35:07 +0200
Subject: [PATCH 07/10] Update docstring, and leave 'toolchain' here

---
 mpsd-software.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mpsd-software.py b/mpsd-software.py
index bc13d36..e04d58a 100755
--- a/mpsd-software.py
+++ b/mpsd-software.py
@@ -1003,7 +1003,11 @@ def environment_status(mpsd_release: str, root_dir: Union[str, Path]) -> dict:
     -------
     toolchain_map : dict
         A dictionary containing available microarchitectures as keys and
-        a list of available toolchains as values for each microarchitecture.
+        a list of available package_sets as values for each microarchitecture.
+
+        Note: only toolchains can be reported at the moment (i.e. package_sets
+        such as global and global_generic are missing, even if installed).
+
     """
     msg = f"Showing status of release {mpsd_release} in {root_dir}"
     logging.info(msg)
-- 
GitLab


From 6e18085adb6fcfbe693b8ccb8a338272bccc12df Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 14 Jun 2023 16:40:07 +0200
Subject: [PATCH 08/10] fix line length

---
 mpsd-software.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mpsd-software.py b/mpsd-software.py
index e04d58a..991cc12 100755
--- a/mpsd-software.py
+++ b/mpsd-software.py
@@ -930,7 +930,8 @@ def install_environment(
 
     for package_set in package_sets:
         if package_set not in available_package_sets:
-            msg = f"Package_Set '{package_set}' is not available in release {mpsd_release}."
+            msg = f"Package_Set '{package_set}' is not available"
+            msg += f" in release {mpsd_release}. "
             msg += "Use 'available' command to see list of available package_sets."
             logging.error(msg)
             sys.exit(1)
@@ -966,7 +967,8 @@ def install_environment(
                 ),
             )
             run(
-                f"bash {spack_setup_script} {' '.join(install_flags)} {package_set} 2>&1 "
+                f"bash {spack_setup_script} "
+                f"{' '.join(install_flags)} {package_set} 2>&1 "
                 f"| tee -a {build_log_path} ",
                 shell=True,
                 check=True,
@@ -975,7 +977,9 @@ def install_environment(
 
 def remove_environment(release, package_sets, target_dir):
     """Remove release from installation."""
-    msg = f"Removing release {release} with package_sets {package_sets} from {target_dir}"
+    msg = (
+        f"Removing release {release} with package_sets {package_sets} from {target_dir}"
+    )
     logging.info(msg)
     raise NotImplementedError(msg)
 
-- 
GitLab


From 0acfd6ca169003a5b1c7a5363646754831035298 Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 14 Jun 2023 17:43:13 +0200
Subject: [PATCH 09/10] fix line length

---
 tests.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests.py b/tests.py
index 45b15bd..7e4a9c3 100644
--- a/tests.py
+++ b/tests.py
@@ -239,7 +239,9 @@ def test_install_environment_zlib():
     #         "cp -r foss2021a-mpi fuss1999a", shell=True, capture_output=True
     #     )
     # add zlib as a spec to global_generic
-    with open(package_set_src_dir / "global_generic" / "global_packages.list", "w") as f:
+    with open(
+        package_set_src_dir / "global_generic" / "global_packages.list", "w"
+    ) as f:
         f.write("zlib@1.2.13 \n")
 
     # add zlib to whitelist of module creation file by replacing anaconda3%gcc@10.2.1
-- 
GitLab


From 1ef263e0f25e2c10b5a2cd02fea42c8b2e7d1dcc Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 14 Jun 2023 17:56:54 +0200
Subject: [PATCH 10/10] toolchain -> package_set

---
 mpsd-software.py | 20 ++++++++++----------
 tests.py         |  8 ++++----
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/mpsd-software.py b/mpsd-software.py
index 991cc12..b3d33e0 100755
--- a/mpsd-software.py
+++ b/mpsd-software.py
@@ -690,7 +690,7 @@ def get_release_info(mpsd_release: str, root_dir: Path) -> Tuple[str, str, List[
     Get information about the specified release.
 
     Get information about the specified release, such as the branch and commit hash
-    of the Spack environments repository and the available toolchains.
+    of the Spack environments repository and the available package_sets.
 
     Parameters
     ----------
@@ -705,8 +705,8 @@ def get_release_info(mpsd_release: str, root_dir: Path) -> Tuple[str, str, List[
         The name of the branch for the Spack environments repository.
     spe_commit_hash : str
         The commit hash for the Spack environments repository.
-    available_toolchains : list
-        A list of strings representing the available toolchains for the release.
+    available_package_sets : list
+        A list of strings representing the available package_sets for the release.
 
     Raises
     ------
@@ -738,8 +738,8 @@ def get_release_info(mpsd_release: str, root_dir: Path) -> Tuple[str, str, List[
                 .stdout.decode()
                 .strip()
             )
-            available_toolchains = os.listdir("toolchains")
-    return spe_branch, spe_commit_hash, available_toolchains
+            available_package_sets = os.listdir("toolchains")
+    return spe_branch, spe_commit_hash, available_package_sets
 
 
 def prepare_environment(mpsd_release: str, root_dir: Path) -> List[str]:
@@ -749,7 +749,7 @@ def prepare_environment(mpsd_release: str, root_dir: Path) -> List[str]:
     It does the following steps:
     Clones the spack-environments repository.
     Determines the branch and commit hash of the spack-environments repository
-    and the available toolchains.
+    and the available package_sets.
     Logs the command usage.
 
     Parameters
@@ -762,8 +762,8 @@ def prepare_environment(mpsd_release: str, root_dir: Path) -> List[str]:
 
     Returns
     -------
-    available_toolchains : list
-        A list of available toolchains for the given MPSD release.
+    available_package_sets : list
+        A list of available package_sets for the given MPSD release.
 
     Example
     -------
@@ -799,13 +799,13 @@ def prepare_environment(mpsd_release: str, root_dir: Path) -> List[str]:
         f"Release {mpsd_release} is prepared in {release_base_dir}"
     )
 
-    spe_branch, spe_commit_hash, available_toolchains = get_release_info(
+    spe_branch, spe_commit_hash, available_package_sets = get_release_info(
         mpsd_release, root_dir
     )
     record_script_execution_summary(
         mpsd_release, root_dir, spe_branch=spe_branch, spe_commit_hash=spe_commit_hash
     )
-    return available_toolchains
+    return available_package_sets
 
 
 def get_native_microarchitecture():
diff --git a/tests.py b/tests.py
index 225c2cf..fd0434a 100644
--- a/tests.py
+++ b/tests.py
@@ -188,9 +188,9 @@ def test_record_script_execution_summary(tmp_path):
         assert "Spack environments branch: dev-23a " in last_line
 
 
-def test_install_environment_wrong_toolchain(tmp_path):
-    """Test exception is raised for non-existing toolchain."""
-    # Expect an Exception when wrong toolchains are provided
+def test_install_environment_wrong_package_set(tmp_path):
+    """Test exception is raised for non-existing package_set."""
+    # Expect an Exception when wrong package_sets are provided
     with pytest.raises(Exception):
         mod.install_environment(
             mpsd_release="dev-23a",
@@ -475,7 +475,7 @@ def test_environment_status(tmp_path):
 def test_interface(tmp_path):
     """Test other things (not implemented yet)."""
     pass
-    # ensure that installing without toolchains only passes the available toolchains
+    # ensure that installing without package_sets only passes the available package_sets
     # check that the script branch and hash are correct when running the script
     # check that the help message is printed when no arguments are provided
     # check that the help message is printed when -h is provided
-- 
GitLab