Skip to content

add support for ModuleGenerator.modulerc method to also write .modulerc file + Lmod 6.x specific check#2611

Merged
vanzod merged 7 commits intoeasybuilders:developfrom
boegel:write_modulerc
Oct 9, 2018
Merged

add support for ModuleGenerator.modulerc method to also write .modulerc file + Lmod 6.x specific check#2611
vanzod merged 7 commits intoeasybuilders:developfrom
boegel:write_modulerc

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Oct 4, 2018

No description provided.

Comment thread easybuild/tools/module_generator.py Outdated
:param modulerc_txt: contents of .modulerc file
:param wrapped_mod_name: name of module file for which a wrapper is defined in the .modulerc file (if any)
"""
if os.path.exists(modulerc_path) and not build_option('force'):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also allow overwriting the .modulerc in the case the user passes --rebuild?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point... Fixed in e1161b5!

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Oct 9, 2018

@damianam Exactly that was implemented in #2597, which is merged for including in EasyBuild v3.7.1 already... :)

@damianam
Copy link
Copy Markdown
Member

damianam commented Oct 9, 2018

I've just seen it down during the review, that's why I deleted my comment. I didn't see your reply until I deleted it :-P

@damianam
Copy link
Copy Markdown
Member

damianam commented Oct 9, 2018

Minimum Lmod version 7.7.38 BTW

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Oct 9, 2018

@damianam Well, OK, if you feel strongly about getting the Lmod required version 100% right, please open a PR to fix that.

Comment thread easybuild/tools/module_generator.py Outdated
def modulerc(self, module_version=None, filepath=None, modulerc_txt=None):
"""
Generate contents of .modulerc file, in Tcl syntax (compatible with all module tools, incl. Lmod).
If 'filepath' is specfiied, the .modulerc file will be written as well.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in specfiied

Comment thread easybuild/tools/module_generator.py Outdated
module_version['sym_modname'] = modname.replace(version, sym_version)
else:
raise EasyBuildError("Version '%s' does not appear in module name '%s'", version, modname)
modname, sym_version, version = [module_version[key] for key in sorted(module_version.keys())]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that the correct order is the same as what sorted returns is purely coincidental. Why not being explicit? It is just 8 extra characters and in my opinion more clear:

modname, sym_version, version = [module_version[key] for key in ['modname', 'sym_version', 'version']]

Comment thread easybuild/tools/module_generator.py Outdated
min_ver = '7.8'
if modulerc_txt is None:
lmod_ver = self.modules_tool.version
min_ver = '7.8'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minimum version is 7.7.38. See TACC/Lmod#376

@vanzod vanzod merged commit 681ee56 into easybuilders:develop Oct 9, 2018
@boegel boegel deleted the write_modulerc branch October 9, 2018 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants