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 and use only_if_module_is_available decorator function to guard functionality that uses optional dependencies #1416

Merged
merged 11 commits into from Oct 8, 2015

Conversation

boegel
Copy link
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
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
Member Author

boegel commented Oct 7, 2015

@wpoely86: remarks fixed, please rereview?

@@ -54,7 +55,7 @@
# failing imports are just ignored
# a NameError should be catched where these are used

# GitPython
# GitPython (http://gitorious.org/git-python)
Copy link
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
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
Contributor

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
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
Contributor

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
Contributor

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
Contributor

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
Contributor

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
Contributor

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
Contributor

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
Contributor

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
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
Contributor

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
Contributor

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
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.

None yet

3 participants