From 5d34b7a332e11cc6f77ff433ca87b9011114fdd5 Mon Sep 17 00:00:00 2001
From: Martin Lang <martin.lang@mpsd.mpg.de>
Date: Thu, 27 Feb 2025 10:23:48 +0100
Subject: [PATCH] String as yaml key instead of Path

---
 src/mpsd_software_manager/spack.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mpsd_software_manager/spack.py b/src/mpsd_software_manager/spack.py
index f5b0bbe..084ee49 100644
--- a/src/mpsd_software_manager/spack.py
+++ b/src/mpsd_software_manager/spack.py
@@ -338,7 +338,10 @@ def refresh_modules(compilers: dict[str, Any] | None = None) -> None:
         module_file = Config().lmod_root / "Core" / intel_module
         family = CLASSIC_FAMILY if "classic" in intel_module else ONEAPI_FAMILY
 
-        modules_to_patch[module_file] = {"family": family, "gcc_module": gcc_module}
+        modules_to_patch[str(module_file)] = {
+            "family": family,
+            "gcc_module": gcc_module,
+        }
 
         if family == "intel_classic_compiler":
             # We need to also patch the intel module, which is loaded as a dependency of
@@ -359,7 +362,7 @@ def refresh_modules(compilers: dict[str, Any] | None = None) -> None:
                 )
                 raise ModuleGenerationError() from e
             oneapi_module_file = Config().lmod_root / "Core" / oneapi_module
-            modules_to_patch[oneapi_module_file] = {
+            modules_to_patch[str(oneapi_module_file)] = {
                 "family": ONEAPI_FAMILY,
                 "gcc_module": gcc_module,
             }
@@ -378,7 +381,7 @@ def refresh_modules(compilers: dict[str, Any] | None = None) -> None:
     for module_file in modules_to_patch:
         gcc_module = modules_to_patch["module_file"]["gcc_module"]
         family = modules_to_patch["module_file"]["family"]
-        patch_intel_module(module_file, gcc_module, family)
+        patch_intel_module(Path(module_file), gcc_module, family)
 
 
 def patch_intel_module(module_file: Path, gcc_module: str, family: str) -> None:
-- 
GitLab