add support for 'eb -a rst', list available easyconfig parameters in RST format#1131
add support for 'eb -a rst', list available easyconfig parameters in RST format#1131boegel merged 7 commits intoeasybuilders:developfrom
Conversation
…-a' which is equivalent to 'eb -a txt'
|
Test FAILed. |
There was a problem hiding this comment.
yeah, I should, I included this as a sort of placeholder...
The problem is that, for example, the constant CUSTOM as it is used in framework/easyconfig/default.py corresponds to the string "CUSTOM".
However, the constant CUSTOM that is imported from framework.easyconfig, as is done in easyblocks when defining custom parameters via extra_options, corresponds to (1, 'easyblock-specific'), since it's obtained from ALL_CATEGORIES in framework/easyconfig/init.py`.
That causes problems when comparing categories, as is done here, since then all categories should be of the same kind, whether they are obtained for default or extra parameters.
I can probably fix it without breaking easyblocks, but I need to think about it. :-)
|
looks fine |
There was a problem hiding this comment.
move to other module (and this is a funciton, not class method)
There was a problem hiding this comment.
ok, will move to easybuild/tools/prettyprint.py
|
Jenkins: test this please |
|
Test PASSed. |
|
Test PASSed. |
…framework/easyconfig/default.py
|
Test PASSed. |
There was a problem hiding this comment.
this is not really acceptable. why is this not
ALL_CATEGORIES = [HIDDEN, ...](that would also define the order) btw.
There was a problem hiding this comment.
here's what's in easybuild/framework/easyconfig/__init__.py:
from easybuild.framework.easyconfig.default import ALL_CATEGORIES
globals().update(ALL_CATEGORIES)ALL_CATEGORIES is only there such that the constants can be defined in the easybuild.framework.easyconfig namespace, it's not used anywhere else; the constants are directly accessible here...
There was a problem hiding this comment.
but now you copy the names again, without any garantee that the keys are the as the constants.
and only because you need HIDDEN? which you could get from
from easybuild.framework.easyconfig import HIDDEN
There was a problem hiding this comment.
no, I need all of them, both in default.py itself, and potentially in easyblocks too (which is what the 'trick' in init is for)
I know no other way to make sure that the names of the constants in default.py and the ones being defined in __init__.py are the same... I'm open to suggestions.
There was a problem hiding this comment.
ok, i overlooked something 😄
i'm just afraid that this very error prone
maybe add a test with
names=['hidden', ...]
for ind,name in enumerate(names):
constname=name.replace('-').upper()
# this validates the import
# i thinkl import returns too
constvalue=import('easybuild.framework.easyconfig', constname)
assert(constane, (ind-1, name))
assert(constvalue, ALL_CATEGORIES[constname]) (or however this works again in python 😄)
|
Test PASSed. |
|
yes indeed, even better solution |
add support for 'eb -a rst', list available easyconfig parameters in RST format
|
@Caylo: can you take a look at extending this to |
This is required to easily update http://easybuild.readthedocs.org/en/latest/eb_a.html#easyconfigs-parameters and use a pretty table format (see for example https://gist.github.com/boegel/490205a6c0607bc7dfc6).
eb -ais still supported, and defaults toeb -a txt; the output has slightly changed, i.e. the descriptions are now left-aligned per group of parameters, which looks a lot better.Once this is merged in, I'll look into supporting
rstfor--list-toolchains,--list-easyblocks,--help, too@wpoely86: please review?