Skip to content

Commit

Permalink
pass down (named) arguments in prepare_step
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Jun 29, 2017
1 parent 7ab22a4 commit d42844e
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 24 deletions.
4 changes: 2 additions & 2 deletions easybuild/easyblocks/d/dl_poly_classic.py
Expand Up @@ -50,9 +50,9 @@ def __init__(self, *args, **kwargs):

# create PLUMED patch in prepare_step rather than patch_step,
# so we can rely on being in the unpacked source directory
def prepare_step(self):
def prepare_step(self, *args, **kwargs):
"""Generate PLUMED patch if PLUMED is listed as a dependency."""
super(EB_DL_underscore_POLY_underscore_Classic, self).prepare_step()
super(EB_DL_underscore_POLY_underscore_Classic, self).prepare_step(*args, **kwargs)

if self.with_plumed:
# see https://groups.google.com/d/msg/plumed-users/cWaIDU5F6Bw/bZUW3J9cCAAJ
Expand Down
6 changes: 4 additions & 2 deletions easybuild/easyblocks/generic/intelbase.py
Expand Up @@ -208,9 +208,11 @@ def setup_local_home_subdir(self):
except OSError, err:
raise EasyBuildError("Failed to symlink %s to %s: %s", self.home_subdir_local, self.home_subdir, err)

def prepare_step(self, requires_runtime_license=True):
def prepare_step(self, *args, **kwargs):
"""Custom prepare step for IntelBase. Set up the license"""
super(IntelBase, self).prepare_step()
requires_runtime_license = kwargs.pop('requires_runtime_license', True)

super(IntelBase, self).prepare_step(*args, **kwargs)

# Decide if we need a license or not (default is True because of defaults of individual Booleans)
self.requires_runtime_license = self.cfg['requires_runtime_license'] and requires_runtime_license
Expand Down
4 changes: 2 additions & 2 deletions easybuild/easyblocks/generic/pythonpackage.py
Expand Up @@ -359,9 +359,9 @@ def prerun(self):
super(PythonPackage, self).prerun()
self.prepare_python()

def prepare_step(self):
def prepare_step(self, *args, **kwargs):
"""Prepare for building and installing this Python package."""
super(PythonPackage, self).prepare_step()
super(PythonPackage, self).prepare_step(*args, **kwargs)
self.prepare_python()

def configure_step(self):
Expand Down
Expand Up @@ -47,10 +47,10 @@ def build_step(self):
"""No build procedure."""
pass

def prepare_step(self):
def prepare_step(self, *args, **kwargs):
"""Set pylibdir"""
self.pylibdir = 'lib'
super(VersionIndependentPythonPackage, self).prepare_step()
super(VersionIndependentPythonPackage, self).prepare_step(*args, **kwargs)

def install_step(self):
"""Custom install procedure to skip selection of python package versions."""
Expand Down
7 changes: 4 additions & 3 deletions easybuild/easyblocks/i/imkl.py
Expand Up @@ -71,11 +71,12 @@ def __init__(self, *args, **kwargs):
# make sure $MKLROOT isn't set, it's known to cause problems with the installation
self.cfg.update('unwanted_env_vars', ['MKLROOT'])

def prepare_step(self):
def prepare_step(self, *args, **kwargs):
if LooseVersion(self.version) >= LooseVersion('2017.2.174'):
super(EB_imkl, self).prepare_step(requires_runtime_license=False)
kwargs['requires_runtime_license'] = False
super(EB_imkl, self).prepare_step(*args, **kwargs)
else:
super(EB_imkl, self).prepare_step()
super(EB_imkl, self).prepare_step(*args, **kwargs)

def install_step(self):
"""
Expand Down
7 changes: 4 additions & 3 deletions easybuild/easyblocks/i/impi.py
Expand Up @@ -58,11 +58,12 @@ def extra_options():
}
return IntelBase.extra_options(extra_vars)

def prepare_step(self):
def prepare_step(self, *args, **kwargs):
if LooseVersion(self.version) >= LooseVersion('2017.2.174'):
super(EB_impi, self).prepare_step(requires_runtime_license=False)
kwargs['requires_runtime_license'] = False
super(EB_impi, self).prepare_step(*args, **kwargs)
else:
super(EB_impi, self).prepare_step()
super(EB_impi, self).prepare_step(*args, **kwargs)

def install_step(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions easybuild/easyblocks/m/mxnet.py
Expand Up @@ -111,9 +111,9 @@ def extract_step(self):
rmtree2(newdir)
symlink(olddir, newdir)

def prepare_step(self):
def prepare_step(self, *args, **kwargs):
"""Prepare for building and installing MXNet."""
super(EB_MXNet, self).prepare_step()
super(EB_MXNet, self).prepare_step(*args, **kwargs)
self.py_ext.prepare_python()

def configure_step(self):
Expand Down
4 changes: 2 additions & 2 deletions easybuild/easyblocks/o/openfoam.py
Expand Up @@ -109,9 +109,9 @@ def patch_step(self, beginpath=None):
self.cfg['start_dir'] = os.path.join(self.installdir, self.openfoamdir)
super(EB_OpenFOAM, self).patch_step(beginpath=self.cfg['start_dir'])

def prepare_step(self):
def prepare_step(self, *args, **kwargs):
"""Prepare for OpenFOAM install procedure."""
super(EB_OpenFOAM, self).prepare_step()
super(EB_OpenFOAM, self).prepare_step(*args, **kwargs)

comp_fam = self.toolchain.comp_family()
if comp_fam == toolchain.GCC: # @UndefinedVariable
Expand Down
4 changes: 2 additions & 2 deletions easybuild/easyblocks/p/paraver.py
Expand Up @@ -64,9 +64,9 @@ def run_all_steps(self, *args, **kwargs):

return super(EB_Paraver, self).run_all_steps(*args, **kwargs)

def prepare_step(self):
def prepare_step(self, *args, **kwargs):
"""Custom prepare step for Paraver: check required dependencies and collect information on them."""
super(EB_Paraver, self).prepare_step()
super(EB_Paraver, self).prepare_step(*args, **kwargs)

# determine value to pass to --with-wxpropgrid (library name)
self.wxpropgrid = None
Expand Down
4 changes: 2 additions & 2 deletions easybuild/easyblocks/p/pdt.py
Expand Up @@ -35,9 +35,9 @@ def __init__(self, *args, **kwargs):
self.machine = out.strip()
self.log.info("Using '%s' as machine label", self.machine)

def prepare_step(self):
def prepare_step(self, *args, **kwargs):
"""Custom prepare step for PDT."""
super(EB_PDT, self).prepare_step()
super(EB_PDT, self).prepare_step(*args, **kwargs)

# create install directory and make sure it does not get cleaned up again in the install step;
# the first configure iteration already puts things in place in the install directory,
Expand Down
4 changes: 2 additions & 2 deletions easybuild/easyblocks/t/tau.py
Expand Up @@ -127,9 +127,9 @@ def run_all_steps(self, *args, **kwargs):

return super(EB_TAU, self).run_all_steps(*args, **kwargs)

def prepare_step(self):
def prepare_step(self, *args, **kwargs):
"""Custom prepare step for Tau: check required dependencies and collect information on them."""
super(EB_TAU, self).prepare_step()
super(EB_TAU, self).prepare_step(*args, **kwargs)

# install prefixes for selected backends
self.backend_opts = {'tau': ''}
Expand Down

0 comments on commit d42844e

Please sign in to comment.