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

flesh out setting up of configuration into dedicated 'set_up_configuration' function #2638

merged 6 commits into from Oct 26, 2018


None yet
2 participants
Copy link

boegel commented Oct 24, 2018

This is basically just shuffling code around, no functional changes are included.

Having a dedicated function for setting up the EasyBuild configuration is useful to support using the EasyBuild framework as a library (see also the tests that have been added).

Before these changes, you'd run into problems like:

$ python -c "from import run_cmd; run_cmd('echo hello')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Volumes/work/easybuild-framework/easybuild/tools/", line 87, in cache_aware_func
    res = func(cmd, *args, **kwargs)
  File "/Volumes/work/easybuild-framework/easybuild/tools/", line 127, in run_cmd
    if log_output or (trace and build_option('trace')):
  File "/Volumes/work/easybuild-framework/easybuild/tools/", line 448, in build_option
    raise EasyBuildError("Undefined build option: %s", key) 'Undefined build option: trace'

When set_up_configuration is used, things work as expected:

$ python -c "from import set_up_configuration; 
set_up_configuration(silent=True); from import run_cmd;
print run_cmd('echo hello')"
('hello\n', 0)

Also, a clearer error is now produced in case set_up_configuration was not called first: "Undefined build option: 'trace'.
Make sure you have set up the EasyBuild configuration using set_up_configuration()
(from in case you're not using EasyBuild via the 'eb' CLI."

boegel added some commits Oct 23, 2018

@boegel boegel added this to the 3.8.0 milestone Oct 24, 2018

@boegel boegel requested a review from bartoldeman Oct 26, 2018

Copy link

bartoldeman left a comment

I checked if you didn't miss deleting any obsolete imports but could not find any. It all looks good to me.


This comment has been minimized.

Copy link

bartoldeman commented Oct 26, 2018

Going in, thanks @boegel !

@bartoldeman bartoldeman merged commit aca7d92 into easybuilders:develop Oct 26, 2018

2 checks passed

Hound No violations found. Woof!
continuous-integration/travis-ci/pr The Travis CI build passed

@boegel boegel deleted the boegel:eb_as_library branch Oct 26, 2018


This comment has been minimized.

Copy link

boegel commented Oct 26, 2018

@bartoldeman My local linter should have noticed if I did miss any obsolete imports ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment