add support for ModuleGenerator.modulerc method to also write .modulerc file + Lmod 6.x specific check#2611
Merged
vanzod merged 7 commits intoeasybuilders:developfrom Oct 9, 2018
Merged
Conversation
This was referenced Oct 4, 2018
vanzod
reviewed
Oct 5, 2018
| :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'): |
Member
There was a problem hiding this comment.
Should we also allow overwriting the .modulerc in the case the user passes --rebuild?
Member
Author
Member
|
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 |
Member
|
Minimum Lmod version |
Member
Author
|
@damianam Well, OK, if you feel strongly about getting the Lmod required version 100% right, please open a PR to fix that. |
damianam
requested changes
Oct 9, 2018
| 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. |
| 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())] |
Member
There was a problem hiding this comment.
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']]
| min_ver = '7.8' | ||
| if modulerc_txt is None: | ||
| lmod_ver = self.modules_tool.version | ||
| min_ver = '7.8' |
damianam
approved these changes
Oct 9, 2018
vanzod
approved these changes
Oct 9, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.