Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions easybuild/framework/easyconfig/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@

_log = fancylogger.getLogger('easyconfig.default', fname=False)

# constants for different categories of easyconfig parameters
# use tuples so we can sort them based on the numbers
HIDDEN = (-1, 'hidden')
MANDATORY = (0, 'mandatory')
CUSTOM = (1, 'easyblock-specific')
TOOLCHAIN = (2, 'toolchain')
BUILD = (3, 'build')
FILEMANAGEMENT = (4, 'file-management')
DEPENDENCIES = (5, 'dependencies')
LICENSE = (6, 'license')
EXTENSIONS = (7, 'extensions')
MODULES = (8, 'modules')
OTHER = (9, 'other')


# we use a tuple here so we can sort them based on the numbers
ALL_CATEGORIES = {
'HIDDEN': (-1, 'hidden'),
'MANDATORY': (0, 'mandatory'),
'CUSTOM': (1, 'easyblock-specific'),
'TOOLCHAIN': (2, 'toolchain'),
'BUILD': (3, 'build'),
'FILEMANAGEMENT': (4, 'file-management'),
'DEPENDENCIES': (5, 'dependencies'),
'LICENSE': (6, 'license'),
'EXTENSIONS': (7, 'extensions'),
'MODULES': (8, 'modules'),
'OTHER': (9, 'other'),
}
# define constants so they can be used below
# avoid that pylint complains about unknown variables in this file
# pylint: disable=E0602
globals().update(ALL_CATEGORIES)
CATEGORY_NAMES = ['BUILD', 'CUSTOM', 'DEPENDENCIES', 'EXTENSIONS', 'FILEMANAGEMENT', 'HIDDEN',
'LICENSE', 'MANDATORY', 'MODULES', 'OTHER', 'TOOLCHAIN']
ALL_CATEGORIES = dict((name, eval(name)) for name in CATEGORY_NAMES)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because flake8 (rightfully) doesn't like us defining constants at runtime by injecting stuff into globals().

If you want me to, I can flesh this out in a separate PR.


# List of tuples. Each tuple has the following format (key, [default, help text, category])
DEFAULT_CONFIG = {
Expand Down Expand Up @@ -151,6 +151,7 @@
'license_server_port': [None, 'Port for license server', LICENSE],

# EXTENSIONS easyconfig parameters
'exts_download_dep_fail': [False, "Fail if downloaded dependencies are detected for extensions", EXTENSIONS],
'exts_classmap': [{}, "Map of extension name to class for handling build and installation.", EXTENSIONS],
'exts_defaultclass': [None, "List of module for and name of the default extension class", EXTENSIONS],
'exts_default_options': [{}, "List of default options for extensions", EXTENSIONS],
Expand All @@ -171,17 +172,17 @@
'moduleclass': ['base', 'Module class to be used for this software', MODULES],
'moduleforceunload': [False, 'Force unload of all modules when loading the extension', MODULES],
'moduleloadnoconflict': [False, "Don't check for conflicts, unload other versions instead ", MODULES],
'module_depends_on' : [False, 'Use depends_on (Lmod 7.6.1+) for dependencies in generated module '
'(implies recursive unloading of modules).', MODULES],
'module_depends_on': [False, 'Use depends_on (Lmod 7.6.1+) for dependencies in generated module '
'(implies recursive unloading of modules).', MODULES],
'recursive_module_unload': [False, 'Recursive unload of all dependencies when unloading module', MODULES],

# MODULES documentation easyconfig parameters
# (docurls is part of MANDATORY)
'docpaths': [None, "List of paths for documentation relative to installation directory", MODULES],
'examples': [None, "Free-form text with examples on using the software", MODULES],
'site_contacts': [None, "String/list of strings with site contacts for the software", MODULES],
'upstream_contacts': [None, ("String/list of strings with upstream contact addresses "
"(e.g., support e-mail, mailing list, bugtracker)"), MODULES],
'upstream_contacts': [None, "String/list of strings with upstream contact addresses "
"(e.g., support e-mail, mailing list, bugtracker)", MODULES],
'usage': [None, "Usage instructions for the software", MODULES],
'whatis': [None, "List of brief (one line) description entries for the software", MODULES],

Expand Down