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 skipping steps in Python packages installed as extension + print progress on individual steps for installing Python packages as extensions #2290

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 22 additions & 5 deletions easybuild/easyblocks/generic/pythonpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@
from easybuild.easyblocks.python import EBPYTHONPREFIXES, EXTS_FILTER_PYTHON_PACKAGES
from easybuild.framework.easyconfig import CUSTOM
from easybuild.framework.extensioneasyblock import ExtensionEasyBlock
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.build_log import EasyBuildError, print_msg
from easybuild.tools.config import build_option
from easybuild.tools.filetools import mkdir, remove_dir, which
from easybuild.tools.modules import get_software_root
from easybuild.tools.py2vs3 import string_type
from easybuild.tools.run import run_cmd
from easybuild.tools.utilities import nub
from easybuild.tools.hooks import CONFIGURE_STEP, BUILD_STEP, TEST_STEP, INSTALL_STEP


# not 'easy_install' deliberately, to avoid that pkg installations listed in easy-install.pth get preference
Expand Down Expand Up @@ -655,10 +656,26 @@ def run(self, *args, **kwargs):
super(PythonPackage, self).run(*args, **kwargs)

# configure, build, test, install
self.configure_step()
self.build_step()
self.test_step()
self.install_step()
# See EasyBlock.get_steps
steps = [
(CONFIGURE_STEP, 'configuring', [lambda x: x.configure_step], True),
(BUILD_STEP, 'building', [lambda x: x.build_step], True),
(TEST_STEP, 'testing', [lambda x: x.test_step], True),
(INSTALL_STEP, "installing", [lambda x: x.install_step], True),
]
self.skip = False # --skip does not apply here
self.silent = build_option('silent')
# See EasyBlock.run_all_steps
for (step_name, descr, step_methods, skippable) in steps:
if self.skip_step(step_name, skippable):
print_msg("\t%s [skipped]" % descr, log=self.log, silent=self.silent)
else:
if self.dry_run:
self.dry_run_msg("\t%s... [DRY RUN]\n", descr)
else:
print_msg("\t%s..." % descr, log=self.log, silent=self.silent)
for step_method in step_methods:
step_method(self)()

def load_module(self, *args, **kwargs):
"""
Expand Down