From 7c48321761b291bb68046722f628360837a134e0 Mon Sep 17 00:00:00 2001 From: Pedro Santos Neves <10762799+Neves-P@users.noreply.github.com> Date: Fri, 31 May 2024 11:52:11 +0200 Subject: [PATCH 1/2] Print message, not warning On ESPResSo version 4.2.1 message, don't use `LmodWarning` but use `LmodMessage` instead --- create_lmodsitepackage.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/create_lmodsitepackage.py b/create_lmodsitepackage.py index ed98d1f0f0..f159f186eb 100755 --- a/create_lmodsitepackage.py +++ b/create_lmodsitepackage.py @@ -175,16 +175,18 @@ end end -local function eessi_espresso_deprecated_warning(t) +local function eessi_espresso_deprecated_message(t) local frameStk = require("FrameStk"):singleton() local mt = frameStk:mt() local simpleName = string.match(t.modFullName, "(.-)/") local version = string.match(t.modFullName, "%d.%d.%d") if simpleName == 'ESPResSo' and version == '4.2.1' then + -- Print a message on loading ESPreSso v <= 4.2.1 recommending using v 4.2.2 and above. + -- A message and not a warning as the exit code would break CI runs otherwise. local advice = 'Prefer versions >= 4.2.2 which include important bugfixes.\\n' advice = advice .. 'For details see https://github.com/espressomd/espresso/releases/tag/4.2.2\\n' advice = advice .. 'Use version 4.2.1 at your own risk!\\n' - LmodWarning("\\nESPResSo v4.2.1 has known issues and has been deprecated. ", advice) + LmodMessage("\\nESPResSo v4.2.1 has known issues and has been deprecated. ", advice) end end From 76babe873669777a79a30e6abc33517873fa31a3 Mon Sep 17 00:00:00 2001 From: Pedro Santos Neves <10762799+Neves-P@users.noreply.github.com> Date: Fri, 31 May 2024 13:57:20 +0200 Subject: [PATCH 2/2] Correctly use `eessi_espresso_deprecated_message()` --- create_lmodsitepackage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_lmodsitepackage.py b/create_lmodsitepackage.py index f159f186eb..7e55bce2a5 100755 --- a/create_lmodsitepackage.py +++ b/create_lmodsitepackage.py @@ -193,7 +193,7 @@ -- Combine both functions into a single one, as we can only register one function as load hook in lmod -- Also: make it non-local, so it can be imported and extended by other lmodrc files if needed function eessi_load_hook(t) - eessi_espresso_deprecated_warning(t) + eessi_espresso_deprecated_message(t) -- Only apply CUDA hooks if the loaded module is in the EESSI prefix -- This avoids getting an Lmod Error when trying to load a CUDA module from a local software stack if from_eessi_prefix(t) then