Skip to content

add and use only_if_module_is_available decorator function to guard functionality that uses optional dependencies#1416

Merged
boegel merged 11 commits intoeasybuilders:developfrom
boegel:only_if_module_is_available
Oct 8, 2015
Merged

add and use only_if_module_is_available decorator function to guard functionality that uses optional dependencies#1416
boegel merged 11 commits intoeasybuilders:developfrom
boegel:only_if_module_is_available

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Oct 7, 2015

This results in removal of some duplicate code, and clean/uniform error messages on missing Python modules, like:

ImportError: No module named gc3libs.core; required module 'gc3libs.core' is not available (provided by Python package gc3pie, available from https://pypi.python.org/pypi/gc3pie)

@wpoely86
Copy link
Copy Markdown
Member

wpoely86 commented Oct 7, 2015

Isn't this a lot of overhead for things like GitPython, GC3Pie etc? The entire file is not useful is you don't have those modules. Why not check it once for those and be done with it.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Oct 7, 2015

@wpoely86: remarks fixed, please rereview?

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.

why not add this url to the decorator below?

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.

the decorator will print the PyPI URL

@hpcugentbot
Copy link
Copy Markdown

EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2129/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

edit: cancelled by @stdweird because the run seemed to be hanging on Jenkins...

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Oct 7, 2015

Jenkins: test this please

@boegel boegel added this to the v2.4.0 milestone Oct 7, 2015
@hpcugentbot
Copy link
Copy Markdown

EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2131/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link
Copy Markdown

EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2132/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link
Copy Markdown

EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2133/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link
Copy Markdown

EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2137/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link
Copy Markdown

EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2139/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link
Copy Markdown

EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2140/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link
Copy Markdown

EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2141/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Oct 8, 2015

4bce8db should fix the issue with the test suite hanging when testing this PR...

apparently, calling Python 2.7 from a subshell of a Python 2.6 session may lead to weird things, e.g. import pysvn segfaulting and resulting in a run_cmd call that never returns (which is what was really going on)

@hpcugentbot
Copy link
Copy Markdown

EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2142/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link
Copy Markdown

EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2144/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Oct 8, 2015

Going in, thanks for the review @wpoely86!

boegel added a commit that referenced this pull request Oct 8, 2015
add and use only_if_module_is_available decorator function to guard functionality that uses optional dependencies
@boegel boegel merged commit 6ed81d1 into easybuilders:develop Oct 8, 2015
@boegel boegel deleted the only_if_module_is_available branch October 8, 2015 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants