Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for only (re)generating module file #1018

Merged
merged 8 commits into from
Apr 24, 2015
15 changes: 13 additions & 2 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1687,9 +1687,20 @@ def run_step(self, step, methods, skippable=False):
"""
Run step, returns false when execution should be stopped
"""
if skippable and (self.skip or step in self.cfg['skipsteps']):
skip = False
Copy link
Contributor

Choose a reason for hiding this comment

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

unused?

Copy link
Contributor

Choose a reason for hiding this comment

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

i would prefer you added a (private)? method to_skip_or_not_to_skip, have it return a boolean (and log message?) and use that.

this rather crucial method is now cluttered with very odd logic, will also make unittesting easier i guess

# skip step if specified, either as individual (skippable) step, or when only generating module file
# still run sanity check when only generating module
skip_individual_step = skippable and (self.skip or step in self.cfg['skipsteps'])
only_module_skip = build_option('only_module') and not step in ['sanitycheck', 'module']
if skip_individual_step or only_module_skip:
self.log.info("Skipping %s step" % step)
else:
skip = True
# allow skipping sanity check too when only generating module via --force
elif build_option('only_module') and step == 'sanitycheck' and build_option('force'):
self.log.info("Skipping %s step, due to combo of --only-module and --force" in ['sanitycheck'])
Copy link
Contributor

Choose a reason for hiding this comment

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

what's with the info message? it just does self.log.info(False)

skip = True

if not skip:
self.log.info("Starting %s step" % step)
# update the config templates
self.update_config_template_run_step()
Expand Down
1 change: 1 addition & 0 deletions easybuild/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def main(testing_data=(None, None, None)):
'ignore_dirs': options.ignore_dirs,
'modules_footer': options.modules_footer,
'only_blocks': options.only_blocks,
'only_module': options.only_module,
'optarch': options.optarch,
'recursive_mod_unload': options.recursive_module_unload,
'regtest_output_dir': options.regtest_output_dir,
Expand Down
1 change: 1 addition & 0 deletions easybuild/tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
'ignore_dirs': None,
'modules_footer': None,
'only_blocks': None,
'only_module': None,
'optarch': None,
'recursive_mod_unload': False,
'regtest_output_dir': None,
Expand Down
1 change: 1 addition & 0 deletions easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def override_options(self):
str, 'extend', None),
'oldstyleconfig': ("Look for and use the oldstyle configuration file.",
None, 'store_true', True),
'only-module': ("Only (re)generate module file", None, 'store_true', False),
Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to generalise this to a step whitelist (the skip option being the step blacklist equivalent)?

'pretend': (("Does the build/installation in a test directory located in $HOME/easybuildinstall"),
None, 'store_true', False, 'p'),
'set-gid-bit': ("Set group ID bit on newly created directories", None, 'store_true', False),
Expand Down