From 16ce0da2b1718eb8461833b056d84cb592efc8cd Mon Sep 17 00:00:00 2001 From: Damian Alvarez <alvarezmallon1@jwlogin02.juwels> Date: Wed, 17 Nov 2021 18:27:58 +0100 Subject: [PATCH] To don't run the dependency tweaker on the CI, so we catch mistakes --- Custom_Hooks/eb_hooks.py | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Custom_Hooks/eb_hooks.py b/Custom_Hooks/eb_hooks.py index 49dcee775..b0a485fa9 100644 --- a/Custom_Hooks/eb_hooks.py +++ b/Custom_Hooks/eb_hooks.py @@ -86,21 +86,20 @@ REQUIRE_MODALTSOFTNAME = { def installation_vetoer(ec): "Check whether this package is NOT supposed to be installed in this system, and abort if necessary" - if os.getenv('CI') is None: - name = ec['name'] - system_name = os.getenv('LMOD_SYSTEM_NAME') - if system_name is None: - with open('/etc/FZJ/systemname') as sn: - system_name = sn.read() - if name in VETOED_INSTALLATIONS[system_name]: - print_warning( - "\nYou are attempting to install software that should not be installed in this system.\n" - "Please double check the list of packages that you are attempting to install. The following\n" - f"packages can't be installed in {system_name}:\n" - ) - for package in VETOED_INSTALLATIONS[system_name]: - print_msg(f"- {package}", stderr=True) - exit(1) + name = ec['name'] + system_name = os.getenv('LMOD_SYSTEM_NAME') + if system_name is None: + with open('/etc/FZJ/systemname') as sn: + system_name = sn.read() + if name in VETOED_INSTALLATIONS[system_name]: + print_warning( + "\nYou are attempting to install software that should not be installed in this system.\n" + "Please double check the list of packages that you are attempting to install. The following\n" + f"packages can't be installed in {system_name}:\n" + ) + for package in VETOED_INSTALLATIONS[system_name]: + print_msg(f"- {package}", stderr=True) + exit(1) def get_user_info(): @@ -205,7 +204,8 @@ def parse_hook(ec, *args, **kwargs): """Custom parse hook to manage installations intended for JSC systems.""" # First of all check if this should be installed - installation_vetoer(ec) + if os.getenv('CI') is None: + installation_vetoer(ec) # Process compiler options ec = inject_compiler_features(ec) @@ -225,7 +225,8 @@ def parse_hook(ec, *args, **kwargs): ec = inject_site_contact_and_user_labels(ec) - ec = tweak_dependencies(ec) + if os.getenv('CI') is None: + ec = tweak_dependencies(ec) # If we are parsing we are not searching, in this case if the easyconfig is # located in the search path, warn that it's dependencies will (most probably) -- GitLab