Skip to content

Commit

Permalink
Rework logic for when to use depends-on
Browse files Browse the repository at this point in the history
  • Loading branch information
Micket committed Sep 19, 2024
1 parent 02b1324 commit c015187
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions easybuild/tools/module_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,9 @@ def load_module(self, mod_name, recursive_unload=None, depends_on=False, unload_
body.extend([self.unload_module(m).strip() for m in unload_modules])
load_template = self.LOAD_TEMPLATE
# Lmod 7.6.1+ supports depends-on which does this most nicely:
if (build_option('mod_depends_on') or depends_on) and self.modules_tool.supports_depends_on:
if (build_option('mod_depends_on') and self.modules_tool.supports_depends_on or depends_on:
if not self.modules_tool.supports_depends_on:
raise EasyBuildError("depends-on statements in generated module are not supported by modules tool")
load_template = self.LOAD_TEMPLATE_DEPENDS_ON

body.append(load_template)
Expand Down Expand Up @@ -1318,7 +1320,9 @@ def load_module(self, mod_name, recursive_unload=None, depends_on=False, unload_

load_template = self.LOAD_TEMPLATE
# Lmod 7.6+ supports depends_on which does this most nicely:
if (build_option('mod_depends_on') or depends_on) and self.modules_tool.supports_depends_on:
if (build_option('mod_depends_on') and self.modules_tool.supports_depends_on or depends_on:
if not self.modules_tool.supports_depends_on:
raise EasyBuildError("depends_on statements in generated module are not supported by modules tool")
load_template = self.LOAD_TEMPLATE_DEPENDS_ON

body.append(load_template)
Expand Down

0 comments on commit c015187

Please sign in to comment.