easybuild.framework.easyconfig.easyconfig module

Easyconfig module that contains the EasyConfig class.

author:Stijn De Weirdt (Ghent University)
author:Dries Verdegem (Ghent University)
author:Kenneth Hoste (Ghent University)
author:Pieter De Baets (Ghent University)
author:Jens Timmerman (Ghent University)
author:Toon Willems (Ghent University)
author:Ward Poelmans (Ghent University)
author:Alan O’Cais (Juelich Supercomputing Centre)
class easybuild.framework.easyconfig.easyconfig.ActiveMNS(*args, **kwargs)

Bases: object

Wrapper class for active module naming scheme.

check_ec_type(ec)

Obtain a full parsed easyconfig file to pass to naming scheme methods if provided keys are insufficient.

det_devel_module_filename(ec, force_visible=False)

Determine devel module filename.

det_full_module_name(ec, force_visible=False)

Determine full module name by selected module naming scheme, based on supplied easyconfig.

det_init_modulepaths(ec)

Determine initial modulepaths according to module naming scheme.

det_install_subdir(ec)

Determine name of software installation subdirectory.

det_modpath_extensions(ec)

Determine modulepath extensions according to module naming scheme.

det_module_subdir(ec)

Determine module subdirectory according to module naming scheme.

Determine list of paths in which symlinks to module files must be created.

det_short_module_name(ec, force_visible=False)

Determine short module name according to module naming scheme.

det_user_modpath_extensions(ec)

Determine user-specific modulepath extensions according to module naming scheme.

expand_toolchain_load(ec=None)

Determine whether load statements for a toolchain should be expanded to load statements for its dependencies. This is useful when toolchains are not exposed to users.

is_short_modname_for(short_modname, name)

Determine whether the specified (short) module name is a module for software with the specified name.

requires_full_easyconfig(keys)

Check whether specified list of easyconfig parameters is sufficient for active module naming scheme.

class easybuild.framework.easyconfig.easyconfig.EasyConfig(path, extra_options=None, build_specs=None, validate=True, hidden=None, rawtxt=None, auto_convert_value_types=True)

Bases: object

Class which handles loading, reading, validation of easyconfigs

all_dependencies

Return list of all dependencies, incl. hidden/build deps & toolchain, but excluding filtered deps.

asdict()

Return dict representation of this EasyConfig instance.

builddependencies()

return the parsed build dependencies

copy()

Return a copy of this EasyConfig instance.

dependencies()

Returns an array of parsed dependencies (after filtering, if requested) dependency = {‘name’: ‘’, ‘version’: ‘’, ‘dummy’: (False|True), ‘versionsuffix’: ‘’, ‘toolchain’: ‘’}

dump(fp)

Dump this easyconfig to file, with the given filename.

extend_params(extra, overwrite=True)

Extend list of known parameters via provided list of extra easyconfig parameters.

filter_hidden_deps()

Filter hidden dependencies from list of (build) dependencies.

generate_template_values()

Try to generate all template values.

get(key, *args, **kwargs)

Check whether any replace easyconfig parameters are still used

handle_external_module_metadata(dep_name)

helper function for _parse_dependency handles metadata for external module dependencies

name

returns name

parse()

Parse the file and set options mandatory requirements are checked here

toolchain

returns the Toolchain used

update(key, value)

Update a string configuration value with a value (i.e. append to it).

validate(check_osdeps=True)

Validate this easyonfig - ensure certain easyconfig parameters are set to a known value (see self.validations) - check OS dependencies - check license

validate_iterate_opts_lists()

Configure/build/install options specified as lists should have same length.

validate_license()

Validate the license

validate_os_deps()

validate presence of OS dependencies osdependencies should be a single list

version

returns version

easybuild.framework.easyconfig.easyconfig.clean_up_easyconfigs(paths)

Clean up easyconfigs (in place) by filtering out comments/buildstats included by EasyBuild in archived easyconfigs (cfr. FileRepository.add_easyconfig in easybuild.tools.repository.filerepo)

Parameters:paths – list of paths to easyconfigs to clean up
easybuild.framework.easyconfig.easyconfig.copy_easyconfigs(paths, target_dir)

Copy easyconfig files to specified directory, in the ‘right’ location and using the filename expected by robot.

Parameters:
  • paths – list of paths to copy to git working dir
  • target_dir – target directory
Returns:

dict with useful information on copied easyconfig files (corresponding EasyConfig instances, paths, status)

easybuild.framework.easyconfig.easyconfig.copy_patch_files(patch_specs, target_dir)

Copy patch files to specified directory, in the ‘right’ location according to the software name they relate to.

Parameters:
  • patch_specs – list of tuples with patch file location and name of software they are for
  • target_dir – target directory
easybuild.framework.easyconfig.easyconfig.create_paths(path, name, version)

Returns all the paths where easyconfig could be located <path> is the basepath <name> should be a string <version> can be a ‘*’ if you use glob patterns, or an install version otherwise

easybuild.framework.easyconfig.easyconfig.det_installversion(version, toolchain_name, toolchain_version, prefix, suffix)

Deprecated ‘det_installversion’ function, to determine exact install version, based on supplied parameters.

easybuild.framework.easyconfig.easyconfig.det_location_for(path, target_dir, soft_name, target_file)

Determine path to easyconfigs directory for specified software name, using specified target file name.

Parameters:
  • path – path of file to copy
  • target_dir – (parent) target directory, should contain easybuild/easyconfigs subdirectory
  • soft_name – software name (to determine location to copy to)
  • target_file – target file name
Returns:

full path to the right location

easybuild.framework.easyconfig.easyconfig.get_easyblock_class(easyblock, name=None, error_on_failed_import=True, error_on_missing_easyblock=None, **kwargs)

Get class for a particular easyblock (or use default)

easybuild.framework.easyconfig.easyconfig.get_module_path(name, generic=False, decode=True)

Determine the module path for a given easyblock or software name, based on the encoded class name.

easybuild.framework.easyconfig.easyconfig.get_toolchain_hierarchy(toolchain)

Determine list of subtoolchains for specified parent toolchain. Result starts with the most minimal subtoolchains first, ends with specified toolchain.

The dummy toolchain is considered the most minimal subtoolchain only if the add_dummy_to_minimal_toolchains build option is enabled.

Parameters:parent_toolchain – dictionary with name/version of parent toolchain
easybuild.framework.easyconfig.easyconfig.handle_deprecated_or_replaced_easyconfig_parameters(ec_method)

Decorator to handle deprecated/replaced easyconfig parameters.

easybuild.framework.easyconfig.easyconfig.letter_dir_for(name)

Determine ‘letter’ directory for specified software name. This usually just the 1st letter of the software name (in lowercase), except for funky software names, e.g. ones starting with a digit.

easybuild.framework.easyconfig.easyconfig.process_easyconfig(path, build_specs=None, validate=True, parse_only=False, hidden=None)

Process easyconfig, returning some information for each block :param path: path to easyconfig file :param build_specs: dictionary specifying build specifications (e.g. version, toolchain, ...) :param validate: whether or not to perform validation :param parse_only: only parse easyconfig superficially (faster, but results in partial info) :param hidden: indicate whether corresponding module file should be installed hidden (‘.’-prefixed)

easybuild.framework.easyconfig.easyconfig.resolve_template(value, tmpl_dict)

Given a value, try to susbstitute the templated strings with actual values. - value: some python object (supported are string, tuple/list, dict or some mix thereof) - tmpl_dict: template dictionary

easybuild.framework.easyconfig.easyconfig.robot_find_easyconfig(name, version)

Find an easyconfig for module in path, returns (absolute) path to easyconfig file (or None, if none is found).

easybuild.framework.easyconfig.easyconfig.robot_find_minimal_toolchain_of_dependency(dep, modtool, parent_tc=None, parent_first=False)

Find the minimal toolchain of a dependency

Parameters:
  • dep – dependency target dict (long and short module names may not exist yet)
  • parent_tc – toolchain from which to derive the toolchain hierarchy to search (default: use dep’s toolchain)
  • parent_first – reverse order in which subtoolchains are considered: parent toolchain, then subtoolchains
Returns:

minimal toolchain for which an easyconfig exists for this dependency (and matches build_options)

easybuild.framework.easyconfig.easyconfig.toolchain_hierarchy_cache(func)

Function decorator to cache (and retrieve cached) toolchain hierarchy queries.

easybuild.framework.easyconfig.easyconfig.verify_easyconfig_filename(path, specs, parsed_ec=None)

Check whether parsed easyconfig at specified path matches expected specs; this basically verifies whether the easyconfig filename corresponds to its contents

Parameters:
  • path – path to easyconfig file
  • specs – expected specs (dict with easyconfig parameter values)
  • parsed_ec – (list of) EasyConfig instance(s) corresponding to easyconfig file