diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 94b66db903..07c9756e67 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -4,6 +4,41 @@ For more detailed information, please see the git log. These release notes can also be consulted at https://easybuild.readthedocs.io/en/latest/Release_notes.html. +v4.9.1 (5 April 2024) +--------------------- + +update/bugfix release + +- various enhancements, including: + - make `is_rpath_wrapper` faster by only checking file contents if file is not located in subdirectory of RPATH wrapper subdirectory (#4406) + - add terse support to `--missing-modules` (#4407) + - adapt version pattern for EnvironmentModules to allow using development version (#4416) + - use `--all` option with EnvironmentModules v4.6+ to get available hidden modules (#4417) + - add support for appending to path environment variables via `modextrapaths_append` + add corresponding `allow_append_abs_path` (#4436) + - improve output produced by `--check-github` (#4437) + - add script for updating local git repos with `develop` branch (#4438) + - show error when multiple PR options are passed (#4440) + - improve `findPythonDeps` script to recognize non-canonical package names (#4445) + - add support for `--from-commit` and `--include-easyblocks-from-commit` (#4468) + - improve logging & handling of (empty) `--optarch` values (#4481) + - add `--short` option to `findUpdatedEcs` script (#4488) + - add generic GCC and Clang compiler flags for RISC-V (#4489) +- various bug fixes, including: + - clean up log file of `EasyBlock` instance in `check_sha256_checksums` (#4452) + - fix description of `backup-modules` configuration option (#4456) + - replace `'` with `"` for `printf` in CI workflow for running test suite to have bash replace a variable (#4461) + - use `cp -dR` instead of `cp -a` for shell script "extraction" (#4465) + - fix link to documentation in `close_pr` message (#4466) + - fix `test_github_merge_pr` by using more recent easyconfigs PR (#4470) + - add workaround for 404 error when installing packages in CI workflow for testing Apptainer integration (#4472) +- other changes: + - clean up & speed up environment checks (#4409) + - use more performant and concise dict construction by using dict comprehensions (#4410) + - remove superflous string formatting (#4411) + - clean up uses of `getattr` and `hasattr` (#4412) + - update copyright lines to 2024 (#4494) + + v4.9.0 (30 December 2023) ------------------------- diff --git a/easybuild/__init__.py b/easybuild/__init__.py index 4763af8bc4..3637c9f395 100644 --- a/easybuild/__init__.py +++ b/easybuild/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2011-2023 Ghent University +# Copyright 2011-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/base/exceptions.py b/easybuild/base/exceptions.py index 3bde7cc6a1..eb004ad217 100644 --- a/easybuild/base/exceptions.py +++ b/easybuild/base/exceptions.py @@ -1,5 +1,5 @@ # -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/base/fancylogger.py b/easybuild/base/fancylogger.py index 96ec7c1f8b..841ba48411 100644 --- a/easybuild/base/fancylogger.py +++ b/easybuild/base/fancylogger.py @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Ghent University +# Copyright 2011-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -146,10 +146,10 @@ def _env_to_boolean(varname, default=False): >>> _env_to_boolean('NO_FOOBAR') False """ - if varname not in os.environ: + try: + return os.environ[varname].lower() in ('1', 'yes', 'true', 'y') + except KeyError: return default - else: - return os.environ.get(varname).lower() in ('1', 'yes', 'true', 'y') OPTIMIZED_ANSWER = "not available in optimized mode" @@ -910,16 +910,15 @@ def resetroot(): _default_logTo = None if 'FANCYLOG_SERVER' in os.environ: server = os.environ['FANCYLOG_SERVER'] - port = DEFAULT_UDP_PORT if ':' in server: server, port = server.split(':') + else: + port = DEFAULT_UDP_PORT # maybe the port was specified in the FANCYLOG_SERVER_PORT env var. this takes precedence - if 'FANCYLOG_SERVER_PORT' in os.environ: - port = int(os.environ['FANCYLOG_SERVER_PORT']) - port = int(port) + port = os.environ.get('FANCYLOG_SERVER_PORT', port) - logToUDP(server, port) + logToUDP(server, int(port)) _default_logTo = logToUDP else: # log to screen by default diff --git a/easybuild/base/generaloption.py b/easybuild/base/generaloption.py index 4b99eab61d..a6b9a0c75e 100644 --- a/easybuild/base/generaloption.py +++ b/easybuild/base/generaloption.py @@ -1,5 +1,5 @@ # -# Copyright 2011-2023 Ghent University +# Copyright 2011-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -202,7 +202,8 @@ class ExtOption(CompleterOption): ALWAYS_TYPED_ACTIONS = Option.ALWAYS_TYPED_ACTIONS + EXTOPTION_EXTRA_OPTIONS TYPE_STRLIST = ['%s%s' % (name, klass) for klass in ['list', 'tuple'] for name in ['str', 'path']] - TYPE_CHECKER = dict([(x, check_str_list_tuple) for x in TYPE_STRLIST] + list(Option.TYPE_CHECKER.items())) + TYPE_CHECKER = {x: check_str_list_tuple for x in TYPE_STRLIST} + TYPE_CHECKER.update(Option.TYPE_CHECKER) TYPES = tuple(TYPE_STRLIST + list(Option.TYPES)) BOOLEAN_ACTIONS = ('store_true', 'store_false',) + EXTOPTION_LOG @@ -810,7 +811,7 @@ def get_env_options(self): epilogprefixtxt += "eg. --some-opt is same as setting %(prefix)s_SOME_OPT in the environment." self.epilog.append(epilogprefixtxt % {'prefix': self.envvar_prefix}) - candidates = dict([(k, v) for k, v in os.environ.items() if k.startswith("%s_" % self.envvar_prefix)]) + candidates = {k: v for k, v in os.environ.items() if k.startswith("%s_" % self.envvar_prefix)} for opt in self._get_all_options(): if opt._long_opts is None: diff --git a/easybuild/base/testing.py b/easybuild/base/testing.py index 9d3cea9d3c..24a2ec4cbf 100644 --- a/easybuild/base/testing.py +++ b/easybuild/base/testing.py @@ -1,5 +1,5 @@ # -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/__init__.py b/easybuild/framework/__init__.py index 019e507d79..f03298abca 100644 --- a/easybuild/framework/__init__.py +++ b/easybuild/framework/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyblock.py b/easybuild/framework/easyblock.py index 9f7ac535a7..72fa56cab8 100644 --- a/easybuild/framework/easyblock.py +++ b/easybuild/framework/easyblock.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/__init__.py b/easybuild/framework/easyconfig/__init__.py index 6d91c028a9..b19017e023 100644 --- a/easybuild/framework/easyconfig/__init__.py +++ b/easybuild/framework/easyconfig/__init__.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/constants.py b/easybuild/framework/easyconfig/constants.py index 2e62580db4..4fe8c9d7b5 100644 --- a/easybuild/framework/easyconfig/constants.py +++ b/easybuild/framework/easyconfig/constants.py @@ -1,5 +1,5 @@ # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/default.py b/easybuild/framework/easyconfig/default.py index 1b197ab912..1d91aa299c 100644 --- a/easybuild/framework/easyconfig/default.py +++ b/easybuild/framework/easyconfig/default.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -60,7 +60,7 @@ # we use a tuple here so we can sort them based on the numbers CATEGORY_NAMES = ['BUILD', 'CUSTOM', 'DEPENDENCIES', 'EXTENSIONS', 'FILEMANAGEMENT', 'HIDDEN', 'LICENSE', 'MANDATORY', 'MODULES', 'OTHER', 'TOOLCHAIN'] -ALL_CATEGORIES = dict((name, eval(name)) for name in CATEGORY_NAMES) +ALL_CATEGORIES = {name: eval(name) for name in CATEGORY_NAMES} # List of tuples. Each tuple has the following format (key, [default, help text, category]) DEFAULT_CONFIG = { diff --git a/easybuild/framework/easyconfig/easyconfig.py b/easybuild/framework/easyconfig/easyconfig.py index dce0ef126b..5f8170b748 100644 --- a/easybuild/framework/easyconfig/easyconfig.py +++ b/easybuild/framework/easyconfig/easyconfig.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -298,7 +298,7 @@ def get_toolchain_hierarchy(parent_toolchain, incl_capabilities=False): """ # obtain list of all possible subtoolchains _, all_tc_classes = search_toolchain('') - subtoolchains = dict((tc_class.NAME, getattr(tc_class, 'SUBTOOLCHAIN', None)) for tc_class in all_tc_classes) + subtoolchains = {tc_class.NAME: getattr(tc_class, 'SUBTOOLCHAIN', None) for tc_class in all_tc_classes} optional_toolchains = set(tc_class.NAME for tc_class in all_tc_classes if getattr(tc_class, 'OPTIONAL', False)) composite_toolchains = set(tc_class.NAME for tc_class in all_tc_classes if len(tc_class.__bases__) > 1) @@ -963,7 +963,7 @@ def filter_hidden_deps(self): faulty_deps = [] # obtain reference to original lists, so their elements can be changed in place - deps = dict([(key, self.get_ref(key)) for key in ['dependencies', 'builddependencies', 'hiddendependencies']]) + deps = {key: self.get_ref(key) for key in ('dependencies', 'builddependencies', 'hiddendependencies')} if 'builddependencies' in self.iterate_options: deplists = copy.deepcopy(deps['builddependencies']) @@ -1207,11 +1207,11 @@ def dump(self, fp, always_overwrite=True, backup=False, explicit_toolchains=Fals # templated values should be dumped unresolved with self.disable_templating(): # build dict of default values - default_values = dict([(key, DEFAULT_CONFIG[key][0]) for key in DEFAULT_CONFIG]) - default_values.update(dict([(key, self.extra_options[key][0]) for key in self.extra_options])) + default_values = {key: DEFAULT_CONFIG[key][0] for key in DEFAULT_CONFIG} + default_values.update({key: self.extra_options[key][0] for key in self.extra_options}) self.generate_template_values() - templ_const = dict([(quote_py_str(const[1]), const[0]) for const in TEMPLATE_CONSTANTS]) + templ_const = {quote_py_str(const[1]): const[0] for const in TEMPLATE_CONSTANTS} # create reverse map of templates, to inject template values where possible # longer template values are considered first, shorter template keys get preference over longer ones @@ -1498,7 +1498,6 @@ def _parse_dependency(self, dep, hidden=False, build_only=False): # convert tuple to string otherwise python might complain about the formatting self.log.debug("Parsing %s as a dependency" % str(dep)) - attr = ['name', 'version', 'versionsuffix', 'toolchain'] dependency = { # full/short module names 'full_mod_name': None, @@ -1554,6 +1553,7 @@ def _parse_dependency(self, dep, hidden=False, build_only=False): raise EasyBuildError("Incorrect external dependency specification: %s", dep) else: # non-external dependency: tuple (or list) that specifies name/version(/versionsuffix(/toolchain)) + attr = ('name', 'version', 'versionsuffix', 'toolchain') dependency.update(dict(zip(attr, dep))) else: @@ -2012,7 +2012,7 @@ def resolve_template(value, tmpl_dict): elif isinstance(value, tuple): value = tuple(resolve_template(list(value), tmpl_dict)) elif isinstance(value, dict): - value = dict((resolve_template(k, tmpl_dict), resolve_template(v, tmpl_dict)) for k, v in value.items()) + value = {resolve_template(k, tmpl_dict): resolve_template(v, tmpl_dict) for k, v in value.items()} return value @@ -2219,7 +2219,7 @@ def verify_easyconfig_filename(path, specs, parsed_ec=None): for ec in ecs: found_fullver = det_full_ec_version(ec['ec']) if ec['ec']['name'] != specs['name'] or found_fullver != fullver: - subspec = dict((key, specs[key]) for key in ['name', 'toolchain', 'version', 'versionsuffix']) + subspec = {key: specs[key] for key in ('name', 'toolchain', 'version', 'versionsuffix')} error_msg = "Contents of %s does not match with filename" % path error_msg += "; expected filename based on contents: %s-%s.eb" % (ec['ec']['name'], found_fullver) error_msg += "; expected (relevant) parameters based on filename %s: %s" % (os.path.basename(path), subspec) diff --git a/easybuild/framework/easyconfig/format/__init__.py b/easybuild/framework/easyconfig/format/__init__.py index b2c084e273..c2a81766ad 100644 --- a/easybuild/framework/easyconfig/format/__init__.py +++ b/easybuild/framework/easyconfig/format/__init__.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/format/convert.py b/easybuild/framework/easyconfig/format/convert.py index 726acd3e6c..82613d42e0 100644 --- a/easybuild/framework/easyconfig/format/convert.py +++ b/easybuild/framework/easyconfig/format/convert.py @@ -1,5 +1,5 @@ # # -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/format/format.py b/easybuild/framework/easyconfig/format/format.py index da8bb97c89..eb8e199f45 100644 --- a/easybuild/framework/easyconfig/format/format.py +++ b/easybuild/framework/easyconfig/format/format.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/format/one.py b/easybuild/framework/easyconfig/format/one.py index 994fc93fed..a4a6041c39 100644 --- a/easybuild/framework/easyconfig/format/one.py +++ b/easybuild/framework/easyconfig/format/one.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/format/pyheaderconfigobj.py b/easybuild/framework/easyconfig/format/pyheaderconfigobj.py index 37e14b529e..8227a40958 100644 --- a/easybuild/framework/easyconfig/format/pyheaderconfigobj.py +++ b/easybuild/framework/easyconfig/format/pyheaderconfigobj.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -51,9 +51,9 @@ def build_easyconfig_constants_dict(): """Make a dictionary with all constants that can be used""" all_consts = [ - ('TEMPLATE_CONSTANTS', dict([(x[0], x[1]) for x in TEMPLATE_CONSTANTS])), - ('EASYCONFIG_CONSTANTS', dict([(key, val[0]) for key, val in EASYCONFIG_CONSTANTS.items()])), - ('EASYCONFIG_LICENSES', dict([(klass().name, name) for name, klass in EASYCONFIG_LICENSES_DICT.items()])), + ('TEMPLATE_CONSTANTS', {x[0]: x[1] for x in TEMPLATE_CONSTANTS}), + ('EASYCONFIG_CONSTANTS', {key: val[0] for key, val in EASYCONFIG_CONSTANTS.items()}), + ('EASYCONFIG_LICENSES', {klass().name: name for name, klass in EASYCONFIG_LICENSES_DICT.items()}), ] err = [] const_dict = {} diff --git a/easybuild/framework/easyconfig/format/two.py b/easybuild/framework/easyconfig/format/two.py index cec3df3636..652b1c9b80 100644 --- a/easybuild/framework/easyconfig/format/two.py +++ b/easybuild/framework/easyconfig/format/two.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/format/version.py b/easybuild/framework/easyconfig/format/version.py index c9f517122b..9588a7e7c0 100644 --- a/easybuild/framework/easyconfig/format/version.py +++ b/easybuild/framework/easyconfig/format/version.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -68,7 +68,7 @@ class VersionOperator(object): '<': op.lt, '<=': op.le, } - REVERSE_OPERATOR_MAP = dict([(v, k) for k, v in OPERATOR_MAP.items()]) + REVERSE_OPERATOR_MAP = {v: k for k, v in OPERATOR_MAP.items()} INCLUDE_OPERATORS = ['==', '>=', '<='] # these operators *include* the (version) boundary ORDERED_OPERATORS = ['==', '>', '>=', '<', '<='] # ordering by strictness OPERATOR_FAMILIES = [['>', '>='], ['<', '<=']] # similar operators diff --git a/easybuild/framework/easyconfig/licenses.py b/easybuild/framework/easyconfig/licenses.py index e8eb1ee3bc..e6286d54e3 100644 --- a/easybuild/framework/easyconfig/licenses.py +++ b/easybuild/framework/easyconfig/licenses.py @@ -1,5 +1,5 @@ # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/parser.py b/easybuild/framework/easyconfig/parser.py index dd53f48890..8f08500815 100644 --- a/easybuild/framework/easyconfig/parser.py +++ b/easybuild/framework/easyconfig/parser.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/style.py b/easybuild/framework/easyconfig/style.py index 10139118e9..28110ca1a4 100644 --- a/easybuild/framework/easyconfig/style.py +++ b/easybuild/framework/easyconfig/style.py @@ -1,5 +1,5 @@ ## -# Copyright 2016-2023 Ghent University +# Copyright 2016-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/templates.py b/easybuild/framework/easyconfig/templates.py index 0d8a4d5cf3..388d80f97a 100644 --- a/easybuild/framework/easyconfig/templates.py +++ b/easybuild/framework/easyconfig/templates.py @@ -1,5 +1,5 @@ # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -257,7 +257,7 @@ def template_constant_dict(config, ignore=None, toolchain=None): # step 2: define *ver and *shortver templates if TEMPLATE_SOFTWARE_VERSIONS: - name_to_prefix = dict((name.lower(), pref) for name, pref in TEMPLATE_SOFTWARE_VERSIONS) + name_to_prefix = {name.lower(): pref for name, pref in TEMPLATE_SOFTWARE_VERSIONS} deps = config.get('dependencies', []) # also consider build dependencies for *ver and *shortver templates; diff --git a/easybuild/framework/easyconfig/tools.py b/easybuild/framework/easyconfig/tools.py index d5c482fecd..c354bec3a9 100644 --- a/easybuild/framework/easyconfig/tools.py +++ b/easybuild/framework/easyconfig/tools.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -60,8 +60,9 @@ from easybuild.tools.filetools import find_easyconfigs, is_patch_file, locate_files from easybuild.tools.filetools import read_file, resolve_path, which, write_file from easybuild.tools.github import GITHUB_EASYCONFIGS_REPO -from easybuild.tools.github import det_pr_labels, det_pr_title, download_repo, fetch_easyconfigs_from_pr, fetch_pr_data -from easybuild.tools.github import fetch_files_from_pr +from easybuild.tools.github import det_pr_labels, det_pr_title, download_repo, fetch_easyconfigs_from_commit +from easybuild.tools.github import fetch_easyconfigs_from_pr, fetch_pr_data +from easybuild.tools.github import fetch_files_from_commit, fetch_files_from_pr from easybuild.tools.multidiff import multidiff from easybuild.tools.toolchain.toolchain import is_system_toolchain from easybuild.tools.toolchain.utilities import search_toolchain @@ -309,7 +310,7 @@ def get_paths_for(subdir=EASYCONFIGS_PKG_SUBDIR, robot_path=None): return paths -def alt_easyconfig_paths(tmpdir, tweaked_ecs=False, from_prs=None, review_pr=None): +def alt_easyconfig_paths(tmpdir, tweaked_ecs=False, from_prs=None, from_commit=None, review_pr=None): """Obtain alternative paths for easyconfig files.""" # paths where tweaked easyconfigs will be placed, easyconfigs listed on the command line take priority and will be @@ -320,18 +321,20 @@ def alt_easyconfig_paths(tmpdir, tweaked_ecs=False, from_prs=None, review_pr=Non tweaked_ecs_paths = (os.path.join(tmpdir, 'tweaked_easyconfigs'), os.path.join(tmpdir, 'tweaked_dep_easyconfigs')) - # paths where files touched in PRs will be downloaded to, - # which are picked up via 'pr_paths' build option in fetch_files_from_pr - pr_paths = [] + # paths where files touched in commit/PRs will be downloaded to, + # which are picked up via 'extra_ec_paths' build option in fetch_files_from_pr + extra_ec_paths = [] if from_prs: - pr_paths = from_prs[:] - if review_pr and review_pr not in pr_paths: - pr_paths.append(review_pr) + extra_ec_paths = from_prs[:] + if review_pr and review_pr not in extra_ec_paths: + extra_ec_paths.append(review_pr) + if extra_ec_paths: + extra_ec_paths = [os.path.join(tmpdir, 'files_pr%s' % pr) for pr in extra_ec_paths] - if pr_paths: - pr_paths = [os.path.join(tmpdir, 'files_pr%s' % pr) for pr in pr_paths] + if from_commit: + extra_ec_paths.append(os.path.join(tmpdir, 'files_commit_' + from_commit)) - return tweaked_ecs_paths, pr_paths + return tweaked_ecs_paths, extra_ec_paths def det_easyconfig_paths(orig_paths): @@ -345,27 +348,31 @@ def det_easyconfig_paths(orig_paths): except ValueError: raise EasyBuildError("Argument to --from-pr must be a comma separated list of PR #s.") + from_commit = build_option('from_commit') robot_path = build_option('robot_path') # list of specified easyconfig files ec_files = orig_paths[:] + commit_files, pr_files = [], [] if from_prs: - pr_files = [] for pr in from_prs: - # path to where easyconfig files should be downloaded is determined via 'pr_paths' build option, - # which corresponds to the list of PR paths returned by alt_easyconfig_paths + # path to where easyconfig files should be downloaded is determined + # via 'extra_ec_paths' build options, + # which corresponds to the list of commit/PR paths returned by alt_easyconfig_paths pr_files.extend(fetch_easyconfigs_from_pr(pr)) - - if ec_files: - # replace paths for specified easyconfigs that are touched in PR - for i, ec_file in enumerate(ec_files): - for pr_file in pr_files: - if ec_file == os.path.basename(pr_file): - ec_files[i] = pr_file - else: - # if no easyconfigs are specified, use all the ones touched in the PR - ec_files = [path for path in pr_files if path.endswith('.eb')] + elif from_commit: + commit_files = fetch_easyconfigs_from_commit(from_commit, files=ec_files) + + if ec_files: + # replace paths for specified easyconfigs that are touched in commit/PRs + for i, ec_file in enumerate(ec_files): + for file in commit_files + pr_files: + if ec_file == os.path.basename(file): + ec_files[i] = file + else: + # if no easyconfigs are specified, use all the ones touched in the commit/PRs + ec_files = [path for path in commit_files + pr_files if path.endswith('.eb')] filter_ecs = build_option('filter_ecs') if filter_ecs: @@ -777,7 +784,7 @@ def avail_easyblocks(): return easyblocks -def det_copy_ec_specs(orig_paths, from_pr): +def det_copy_ec_specs(orig_paths, from_pr=None, from_commit=None): """Determine list of paths + target directory for --copy-ec.""" if from_pr is not None and not isinstance(from_pr, list): @@ -841,4 +848,41 @@ def det_copy_ec_specs(orig_paths, from_pr): elif pr_matches: raise EasyBuildError("Found multiple paths for %s in PR: %s", filename, pr_matches) + # consider --from-commit (only if --from-pr was not used) + elif from_commit: + tmpdir = os.path.join(tempfile.gettempdir(), 'fetch_files_from_commit_%s' % from_commit) + commit_paths = fetch_files_from_commit(from_commit, path=tmpdir) + + # assume that files need to be copied to current working directory for now + target_path = os.getcwd() + + if orig_paths: + last_path = orig_paths[-1] + + # check files touched by commit and see if the target directory for --copy-ec + # corresponds to the name of one of these files; + # if so we should copy the specified file(s) to the current working directory, + # since interpreting the last argument as target location is very unlikely to be correct in this case + commit_filenames = [os.path.basename(p) for p in commit_paths] + if last_path in commit_filenames: + paths = orig_paths[:] + else: + target_path = last_path + # exclude last argument that is used as target location + paths = orig_paths[:-1] + + # if list of files to copy is empty at this point, + # we simply copy *all* files touched by the PR + if not paths: + paths = commit_paths + + # replace path for files touched by commit (no need to worry about others) + for idx, path in enumerate(paths): + filename = os.path.basename(path) + commit_matches = [x for x in commit_paths if os.path.basename(x) == filename] + if len(commit_matches) == 1: + paths[idx] = commit_matches[0] + elif commit_matches: + raise EasyBuildError("Found multiple paths for %s in commit: %s", filename, commit_matches) + return paths, target_path diff --git a/easybuild/framework/easyconfig/tweak.py b/easybuild/framework/easyconfig/tweak.py index c27c8f8728..3ec3c342ea 100644 --- a/easybuild/framework/easyconfig/tweak.py +++ b/easybuild/framework/easyconfig/tweak.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easyconfig/types.py b/easybuild/framework/easyconfig/types.py index 451d22af03..b7af38867e 100644 --- a/easybuild/framework/easyconfig/types.py +++ b/easybuild/framework/easyconfig/types.py @@ -1,5 +1,5 @@ # # -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/easystack.py b/easybuild/framework/easystack.py index 9ab411c918..f81380a0bd 100644 --- a/easybuild/framework/easystack.py +++ b/easybuild/framework/easystack.py @@ -1,4 +1,4 @@ -# Copyright 2020-2023 Ghent University +# Copyright 2020-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/extension.py b/easybuild/framework/extension.py index 114534df7f..c6020706d5 100644 --- a/easybuild/framework/extension.py +++ b/easybuild/framework/extension.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/framework/extensioneasyblock.py b/easybuild/framework/extensioneasyblock.py index c06fb56e0f..e48947a694 100644 --- a/easybuild/framework/extensioneasyblock.py +++ b/easybuild/framework/extensioneasyblock.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of the University of Ghent (http://ugent.be/hpc). diff --git a/easybuild/main.py b/easybuild/main.py index 9272c7abef..0496d644c4 100644 --- a/easybuild/main.py +++ b/easybuild/main.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -328,7 +328,7 @@ def process_eb_args(eb_args, eb_go, cfg_settings, modtool, testing, init_session if options.copy_ec: # figure out list of files to copy + target location (taking into account --from-pr) - eb_args, target_path = det_copy_ec_specs(eb_args, from_pr_list) + eb_args, target_path = det_copy_ec_specs(eb_args, from_pr=from_pr_list, from_commit=options.from_commit) categorized_paths = categorize_files_by_type(eb_args) @@ -507,7 +507,7 @@ def process_eb_args(eb_args, eb_go, cfg_settings, modtool, testing, init_session # dry_run: print all easyconfigs and dependencies, and whether they are already built elif dry_run_mode: if options.missing_modules: - txt = missing_deps(easyconfigs, modtool) + txt = missing_deps(easyconfigs, modtool, terse=options.terse) else: txt = dry_run(easyconfigs, modtool, short=not options.dry_run) print_msg(txt, log=_log, silent=testing, prefix=False) @@ -693,7 +693,9 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None, pr options.list_prs, options.merge_pr, options.review_pr, - options.terse, + # --missing-modules is processed by process_eb_args, + # so we can't exit just yet here if it's used in combination with --terse + options.terse and not options.missing_modules, search_query, ] if any(early_stop_options): @@ -730,7 +732,7 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None, pr # stop logging and cleanup tmp log file, unless one build failed (individual logs are located in eb_tmpdir) stop_logging(logfile, logtostdout=options.logtostdout) if do_cleanup: - cleanup(logfile, eb_tmpdir, testing, silent=False) + cleanup(logfile, eb_tmpdir, testing, silent=options.terse) def prepare_main(args=None, logfile=None, testing=None): @@ -745,8 +747,7 @@ def prepare_main(args=None, logfile=None, testing=None): # if $CDPATH is set, unset it, it'll only cause trouble... # see https://github.com/easybuilders/easybuild-framework/issues/2944 - if 'CDPATH' in os.environ: - del os.environ['CDPATH'] + os.environ.pop('CDPATH', None) # When EB is run via `exec` the special bash variable $_ is not set # So emulate this here to allow (module) scripts depending on that to work @@ -761,8 +762,14 @@ def prepare_main(args=None, logfile=None, testing=None): def main_with_hooks(args=None): - init_session_state, eb_go, cfg_settings = prepare_main(args=args) + # take into account that EasyBuildError may be raised when parsing the EasyBuild configuration + try: + init_session_state, eb_go, cfg_settings = prepare_main() + except EasyBuildError as err: + print_error(err.msg) + hooks = load_hooks(eb_go.options.hooks) + try: main(args=args, prepared_cfg_data=(init_session_state, eb_go, cfg_settings)) except EasyBuildError as err: diff --git a/easybuild/scripts/clean_gists.py b/easybuild/scripts/clean_gists.py index 5cb9eac8f5..b166191c12 100755 --- a/easybuild/scripts/clean_gists.py +++ b/easybuild/scripts/clean_gists.py @@ -1,6 +1,6 @@ #!/usr/bin/env python ## -# Copyright 2014 Ward Poelmans +# Copyright 2014-2024 Ward Poelmans # # https://github.com/easybuilders/easybuild # diff --git a/easybuild/scripts/findUpdatedEcs.sh b/easybuild/scripts/findUpdatedEcs.sh index d6631bfe0b..66b7e34bd8 100755 --- a/easybuild/scripts/findUpdatedEcs.sh +++ b/easybuild/scripts/findUpdatedEcs.sh @@ -33,51 +33,57 @@ function checkModule { first_letter=${ec_filename:0:1} letterPath=$easyconfigFolder/${first_letter,,} if [[ -d "$letterPath" ]]; then - ec_new="$(find "$letterPath" -type f -name "$ec_filename")" + ec_new="$(find "$letterPath" -type f -name "$ec_filename")" else - ec_new= + ec_new= fi # Fallback if not found [[ -n "$ec_new" ]] || ec_new="$(find "$easyconfigFolder" -type f -name "$ec_filename")" if [[ -z "$ec_new" ]]; then - printError "=== Did not find new EC $ec_filename" + printError "=== Did not find new EC $ec_filename" elif [[ ! -e "$ec_new" ]]; then printError "=== Found multiple new ECs: $ec_new" - elif ! out=$(diff "$ec_installed" "$ec_new"); then - echo -e "${YELLOW}=== Needs updating: ${GREEN}${ec_installed}${YELLOW} vs ${GREEN}${ec_new}${NC}" - if ((showDiff == 1)); then - echo "$out" + elif ! out=$(diff -u "$ec_installed" "$ec_new"); then + if ((short == 1)); then + basename "$ec_installed" + else + echo -e "${YELLOW}=== Needs updating: ${GREEN}${ec_installed}${YELLOW} vs ${GREEN}${ec_new}${NC}" + if ((showDiff == 1)); then + echo "$out" + fi fi fi } ecDefaultFolder= if path=$(which eb 2>/dev/null); then - path=$(dirname "$path") - for p in "$path" "$(dirname "$path")"; do - if [ -d "$p/easybuild/easyconfigs" ]; then - ecDefaultFolder=$p - break - fi - done + path=$(dirname "$path") + for p in "$path" "$(dirname "$path")"; do + if [ -d "$p/easybuild/easyconfigs" ]; then + ecDefaultFolder=$p + break + fi + done fi function usage { - echo "Usage: $(basename "$0") [--verbose] [--diff] --loaded|--modules INSTALLPATH --easyconfigs EC-FOLDER" - echo - echo "Check installed modules against the source EasyConfig (EC) files to determine which have changed." - echo "Can either check the currently loaded modules or all modules installed in a specific location" - echo - echo "--verbose Verbose status output while checking" - echo "--loaded Check only currently loaded modules" - echo "--diff Show diff of changed module files" - echo "--modules INSTALLPATH Check all modules in the specified (software) installpath, i.e. the root of module-binaries" - echo "--easyconfigs EC-FOLDER Path to the folder containg the current/updated EasyConfigs. ${ecDefaultFolder:+Defaults to $ecDefaultFolder}" - exit 0 + echo "Usage: $(basename "$0") [--verbose] [--diff] --loaded|--modules INSTALLPATH --easyconfigs EC-FOLDER" + echo + echo "Check installed modules against the source EasyConfig (EC) files to determine which have changed." + echo "Can either check the currently loaded modules or all modules installed in a specific location" + echo + echo "--verbose Verbose status output while checking" + echo "--loaded Check only currently loaded modules" + echo "--short Only show filename of changed ECs" + echo "--diff Show diff of changed module files" + echo "--modules INSTALLPATH Check all modules in the specified (software) installpath, i.e. the root of module-binaries" + echo "--easyconfigs EC-FOLDER Path to the folder containg the current/updated EasyConfigs. ${ecDefaultFolder:+Defaults to $ecDefaultFolder}" + exit 0 } checkLoadedModules=0 showDiff=0 +short=0 modulesFolder="" easyconfigFolder=$ecDefaultFolder @@ -89,6 +95,8 @@ while [[ $# -gt 0 ]]; do verbose=1;; -d|--diff) showDiff=1;; + -s|--short) + short=1;; -l|--loaded) checkLoadedModules=1;; -m|--modules) diff --git a/easybuild/scripts/fix_docs.py b/easybuild/scripts/fix_docs.py index 388fb360d9..a14f18caf8 100755 --- a/easybuild/scripts/fix_docs.py +++ b/easybuild/scripts/fix_docs.py @@ -1,6 +1,6 @@ #!/usr/bin/env python ## -# Copyright 2016-2023 Ghent University +# Copyright 2016-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/scripts/mk_tmpl_easyblock_for.py b/easybuild/scripts/mk_tmpl_easyblock_for.py index 1cd63393d6..b8b554d0a9 100755 --- a/easybuild/scripts/mk_tmpl_easyblock_for.py +++ b/easybuild/scripts/mk_tmpl_easyblock_for.py @@ -1,6 +1,6 @@ #!/usr/bin/env python ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/scripts/rpath_args.py b/easybuild/scripts/rpath_args.py index 1bc87a1679..b477aa63d8 100755 --- a/easybuild/scripts/rpath_args.py +++ b/easybuild/scripts/rpath_args.py @@ -1,6 +1,6 @@ #!/usr/bin/env python ## -# Copyright 2016-2023 Ghent University +# Copyright 2016-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/scripts/rpath_wrapper_template.sh.in b/easybuild/scripts/rpath_wrapper_template.sh.in index 73eb21f0e0..5644a7ca75 100644 --- a/easybuild/scripts/rpath_wrapper_template.sh.in +++ b/easybuild/scripts/rpath_wrapper_template.sh.in @@ -1,6 +1,6 @@ #!/usr/bin/env bash ## -# Copyright 2016-2023 Ghent University +# Copyright 2016-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/__init__.py b/easybuild/toolchains/__init__.py index 309b1808cf..2f468f2812 100644 --- a/easybuild/toolchains/__init__.py +++ b/easybuild/toolchains/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/cgmpich.py b/easybuild/toolchains/cgmpich.py index ea04e20e75..9e25c6ec57 100644 --- a/easybuild/toolchains/cgmpich.py +++ b/easybuild/toolchains/cgmpich.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/cgmpolf.py b/easybuild/toolchains/cgmpolf.py index b335781374..5629ee5be3 100644 --- a/easybuild/toolchains/cgmpolf.py +++ b/easybuild/toolchains/cgmpolf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/cgmvapich2.py b/easybuild/toolchains/cgmvapich2.py index e347cab483..76e306b12d 100644 --- a/easybuild/toolchains/cgmvapich2.py +++ b/easybuild/toolchains/cgmvapich2.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/cgmvolf.py b/easybuild/toolchains/cgmvolf.py index 1b9e122fcd..e68aa90fe1 100644 --- a/easybuild/toolchains/cgmvolf.py +++ b/easybuild/toolchains/cgmvolf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/cgompi.py b/easybuild/toolchains/cgompi.py index 559f91f4ad..9b9267bf78 100644 --- a/easybuild/toolchains/cgompi.py +++ b/easybuild/toolchains/cgompi.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/cgoolf.py b/easybuild/toolchains/cgoolf.py index c26e94b724..8e2ea8503e 100644 --- a/easybuild/toolchains/cgoolf.py +++ b/easybuild/toolchains/cgoolf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/clanggcc.py b/easybuild/toolchains/clanggcc.py index 8537354ebe..c1e09e68ef 100644 --- a/easybuild/toolchains/clanggcc.py +++ b/easybuild/toolchains/clanggcc.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/compiler/__init__.py b/easybuild/toolchains/compiler/__init__.py index 5933777f43..9c1ba469c5 100644 --- a/easybuild/toolchains/compiler/__init__.py +++ b/easybuild/toolchains/compiler/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/compiler/clang.py b/easybuild/toolchains/compiler/clang.py index df099fa659..1e925ec210 100644 --- a/easybuild/toolchains/compiler/clang.py +++ b/easybuild/toolchains/compiler/clang.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. @@ -97,6 +97,7 @@ class Clang(Compiler): } # used with --optarch=GENERIC COMPILER_GENERIC_OPTION = { + (systemtools.RISCV64, systemtools.RISCV): 'march=rv64gc -mabi=lp64d', # default for -mabi is system-dependent (systemtools.X86_64, systemtools.AMD): 'march=x86-64 -mtune=generic', (systemtools.X86_64, systemtools.INTEL): 'march=x86-64 -mtune=generic', } diff --git a/easybuild/toolchains/compiler/craype.py b/easybuild/toolchains/compiler/craype.py index a0bec9f624..73b6a103e2 100644 --- a/easybuild/toolchains/compiler/craype.py +++ b/easybuild/toolchains/compiler/craype.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/compiler/cuda.py b/easybuild/toolchains/compiler/cuda.py index c87f1b21d1..3fd3d705f1 100644 --- a/easybuild/toolchains/compiler/cuda.py +++ b/easybuild/toolchains/compiler/cuda.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/compiler/fujitsu.py b/easybuild/toolchains/compiler/fujitsu.py index e7a861c1b7..437ec34048 100644 --- a/easybuild/toolchains/compiler/fujitsu.py +++ b/easybuild/toolchains/compiler/fujitsu.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/compiler/gcc.py b/easybuild/toolchains/compiler/gcc.py index 9ef98f5038..a9b44db2d2 100644 --- a/easybuild/toolchains/compiler/gcc.py +++ b/easybuild/toolchains/compiler/gcc.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -94,6 +94,7 @@ class Gcc(Compiler): (systemtools.AARCH64, systemtools.ARM): 'mcpu=generic', # implies -march=armv8-a and -mtune=generic (systemtools.POWER, systemtools.POWER): 'mcpu=powerpc64', # no support for -march on POWER (systemtools.POWER, systemtools.POWER_LE): 'mcpu=powerpc64le', # no support for -march on POWER + (systemtools.RISCV64, systemtools.RISCV): 'march=rv64gc -mabi=lp64d', # default for -mabi is system-dependent (systemtools.X86_64, systemtools.AMD): 'march=x86-64 -mtune=generic', (systemtools.X86_64, systemtools.INTEL): 'march=x86-64 -mtune=generic', } diff --git a/easybuild/toolchains/compiler/intel_compilers.py b/easybuild/toolchains/compiler/intel_compilers.py index ae97dfa87d..1a21b21943 100644 --- a/easybuild/toolchains/compiler/intel_compilers.py +++ b/easybuild/toolchains/compiler/intel_compilers.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/compiler/inteliccifort.py b/easybuild/toolchains/compiler/inteliccifort.py index 1fdd04b42e..9287a0b056 100644 --- a/easybuild/toolchains/compiler/inteliccifort.py +++ b/easybuild/toolchains/compiler/inteliccifort.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/compiler/nvhpc.py b/easybuild/toolchains/compiler/nvhpc.py index 549c0e9a70..2011137716 100644 --- a/easybuild/toolchains/compiler/nvhpc.py +++ b/easybuild/toolchains/compiler/nvhpc.py @@ -1,5 +1,5 @@ ## -# Copyright 2015 Bart Oldeman +# Copyright 2015-2024 Bart Oldeman # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/compiler/pgi.py b/easybuild/toolchains/compiler/pgi.py index 77f04fe813..0f55614926 100644 --- a/easybuild/toolchains/compiler/pgi.py +++ b/easybuild/toolchains/compiler/pgi.py @@ -1,5 +1,5 @@ ## -# Copyright 2015 Bart Oldeman +# Copyright 2015-2024 Bart Oldeman # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/compiler/systemcompiler.py b/easybuild/toolchains/compiler/systemcompiler.py index 505f002d57..d1fd06d4d9 100644 --- a/easybuild/toolchains/compiler/systemcompiler.py +++ b/easybuild/toolchains/compiler/systemcompiler.py @@ -1,5 +1,5 @@ ## -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/craycce.py b/easybuild/toolchains/craycce.py index cb9a4ff80e..13b92e55d2 100644 --- a/easybuild/toolchains/craycce.py +++ b/easybuild/toolchains/craycce.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/craygnu.py b/easybuild/toolchains/craygnu.py index 4e42d32f94..8d198362bd 100644 --- a/easybuild/toolchains/craygnu.py +++ b/easybuild/toolchains/craygnu.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/crayintel.py b/easybuild/toolchains/crayintel.py index 76cde0a8bc..5997eb63d6 100644 --- a/easybuild/toolchains/crayintel.py +++ b/easybuild/toolchains/crayintel.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/craypgi.py b/easybuild/toolchains/craypgi.py index 67e2bcec78..49004775a4 100644 --- a/easybuild/toolchains/craypgi.py +++ b/easybuild/toolchains/craypgi.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/fcc.py b/easybuild/toolchains/fcc.py index 9dedfd3a33..038b7540c3 100644 --- a/easybuild/toolchains/fcc.py +++ b/easybuild/toolchains/fcc.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/ffmpi.py b/easybuild/toolchains/ffmpi.py index 34a56d229e..71a49f7913 100644 --- a/easybuild/toolchains/ffmpi.py +++ b/easybuild/toolchains/ffmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/fft/__init__.py b/easybuild/toolchains/fft/__init__.py index 9915268575..afcf0211dd 100644 --- a/easybuild/toolchains/fft/__init__.py +++ b/easybuild/toolchains/fft/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/fft/fftw.py b/easybuild/toolchains/fft/fftw.py index 63d39cb658..9cb4c4e851 100644 --- a/easybuild/toolchains/fft/fftw.py +++ b/easybuild/toolchains/fft/fftw.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/fft/fujitsufftw.py b/easybuild/toolchains/fft/fujitsufftw.py index 1e2ed28ec6..4de1769528 100644 --- a/easybuild/toolchains/fft/fujitsufftw.py +++ b/easybuild/toolchains/fft/fujitsufftw.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/fft/intelfftw.py b/easybuild/toolchains/fft/intelfftw.py index ad8f08ffd8..7882278a91 100644 --- a/easybuild/toolchains/fft/intelfftw.py +++ b/easybuild/toolchains/fft/intelfftw.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/foss.py b/easybuild/toolchains/foss.py index d5e57956a0..031daa4c9c 100644 --- a/easybuild/toolchains/foss.py +++ b/easybuild/toolchains/foss.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/fosscuda.py b/easybuild/toolchains/fosscuda.py index a35c570781..9465515d36 100644 --- a/easybuild/toolchains/fosscuda.py +++ b/easybuild/toolchains/fosscuda.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/fujitsu.py b/easybuild/toolchains/fujitsu.py index ed858a84c7..707255e03c 100644 --- a/easybuild/toolchains/fujitsu.py +++ b/easybuild/toolchains/fujitsu.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gcc.py b/easybuild/toolchains/gcc.py index e359b8aa01..71091e795c 100644 --- a/easybuild/toolchains/gcc.py +++ b/easybuild/toolchains/gcc.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gcccore.py b/easybuild/toolchains/gcccore.py index 87eaf4d1b6..ce4703e89c 100644 --- a/easybuild/toolchains/gcccore.py +++ b/easybuild/toolchains/gcccore.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gcccuda.py b/easybuild/toolchains/gcccuda.py index fcf0981bac..47ab250824 100644 --- a/easybuild/toolchains/gcccuda.py +++ b/easybuild/toolchains/gcccuda.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gfbf.py b/easybuild/toolchains/gfbf.py index 9a7f279e6d..d41f5b7d06 100644 --- a/easybuild/toolchains/gfbf.py +++ b/easybuild/toolchains/gfbf.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gimkl.py b/easybuild/toolchains/gimkl.py index 8505cf5b87..1d7b9704f6 100644 --- a/easybuild/toolchains/gimkl.py +++ b/easybuild/toolchains/gimkl.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gimpi.py b/easybuild/toolchains/gimpi.py index 6ac9788749..76e6bd638a 100644 --- a/easybuild/toolchains/gimpi.py +++ b/easybuild/toolchains/gimpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gimpic.py b/easybuild/toolchains/gimpic.py index 01a28c78ee..dde1d6c8f8 100644 --- a/easybuild/toolchains/gimpic.py +++ b/easybuild/toolchains/gimpic.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/giolf.py b/easybuild/toolchains/giolf.py index 64b99f2a5c..121c81121b 100644 --- a/easybuild/toolchains/giolf.py +++ b/easybuild/toolchains/giolf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/giolfc.py b/easybuild/toolchains/giolfc.py index 3ca3111542..df798626aa 100644 --- a/easybuild/toolchains/giolfc.py +++ b/easybuild/toolchains/giolfc.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gmacml.py b/easybuild/toolchains/gmacml.py index 5561f85286..ee95c3f7f3 100644 --- a/easybuild/toolchains/gmacml.py +++ b/easybuild/toolchains/gmacml.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gmkl.py b/easybuild/toolchains/gmkl.py index a58a05c488..67e33e1e62 100644 --- a/easybuild/toolchains/gmkl.py +++ b/easybuild/toolchains/gmkl.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gmklc.py b/easybuild/toolchains/gmklc.py index b7ecd19115..bead896d5e 100644 --- a/easybuild/toolchains/gmklc.py +++ b/easybuild/toolchains/gmklc.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gmpich.py b/easybuild/toolchains/gmpich.py index 941421e50e..66d2b29123 100644 --- a/easybuild/toolchains/gmpich.py +++ b/easybuild/toolchains/gmpich.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gmpich2.py b/easybuild/toolchains/gmpich2.py index bad4e0bbaf..f734d3cb56 100644 --- a/easybuild/toolchains/gmpich2.py +++ b/easybuild/toolchains/gmpich2.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gmpit.py b/easybuild/toolchains/gmpit.py index 395940a639..a39baf934d 100644 --- a/easybuild/toolchains/gmpit.py +++ b/easybuild/toolchains/gmpit.py @@ -1,5 +1,5 @@ ## -# Copyright 2022-2023 Ghent University +# Copyright 2022-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gmpolf.py b/easybuild/toolchains/gmpolf.py index 2bca2b44dd..c5a8be97d9 100644 --- a/easybuild/toolchains/gmpolf.py +++ b/easybuild/toolchains/gmpolf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/gmvapich2.py b/easybuild/toolchains/gmvapich2.py index 46ebb4d489..26aa6ad73e 100644 --- a/easybuild/toolchains/gmvapich2.py +++ b/easybuild/toolchains/gmvapich2.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gmvolf.py b/easybuild/toolchains/gmvolf.py index 50c943cde6..613d8a6ed3 100644 --- a/easybuild/toolchains/gmvolf.py +++ b/easybuild/toolchains/gmvolf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/gnu.py b/easybuild/toolchains/gnu.py index a16eed38bd..84b06af535 100644 --- a/easybuild/toolchains/gnu.py +++ b/easybuild/toolchains/gnu.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/goalf.py b/easybuild/toolchains/goalf.py index d833e3c1c5..db1280907b 100644 --- a/easybuild/toolchains/goalf.py +++ b/easybuild/toolchains/goalf.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gobff.py b/easybuild/toolchains/gobff.py index 2cbb366dfe..9df26ff706 100644 --- a/easybuild/toolchains/gobff.py +++ b/easybuild/toolchains/gobff.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/goblf.py b/easybuild/toolchains/goblf.py index 618d813149..63e7c0c0a4 100644 --- a/easybuild/toolchains/goblf.py +++ b/easybuild/toolchains/goblf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gofbf.py b/easybuild/toolchains/gofbf.py index 71269a57df..3128c87091 100644 --- a/easybuild/toolchains/gofbf.py +++ b/easybuild/toolchains/gofbf.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/golf.py b/easybuild/toolchains/golf.py index c318ec9fee..6d046413a8 100644 --- a/easybuild/toolchains/golf.py +++ b/easybuild/toolchains/golf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/golfc.py b/easybuild/toolchains/golfc.py index bdce5ddcec..3b99dce5c0 100644 --- a/easybuild/toolchains/golfc.py +++ b/easybuild/toolchains/golfc.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gomkl.py b/easybuild/toolchains/gomkl.py index 663bc32daa..ba93882a1b 100644 --- a/easybuild/toolchains/gomkl.py +++ b/easybuild/toolchains/gomkl.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gomklc.py b/easybuild/toolchains/gomklc.py index fa19da4b50..95620d8360 100644 --- a/easybuild/toolchains/gomklc.py +++ b/easybuild/toolchains/gomklc.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gompi.py b/easybuild/toolchains/gompi.py index 35db8a8330..7af87123c9 100644 --- a/easybuild/toolchains/gompi.py +++ b/easybuild/toolchains/gompi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gompic.py b/easybuild/toolchains/gompic.py index a9f08dcf2a..0beb2b4d10 100644 --- a/easybuild/toolchains/gompic.py +++ b/easybuild/toolchains/gompic.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/goolf.py b/easybuild/toolchains/goolf.py index 6577cb31c4..099f7bc11a 100644 --- a/easybuild/toolchains/goolf.py +++ b/easybuild/toolchains/goolf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/goolfc.py b/easybuild/toolchains/goolfc.py index 26cd18ec9b..76cf4db890 100644 --- a/easybuild/toolchains/goolfc.py +++ b/easybuild/toolchains/goolfc.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gpsmpi.py b/easybuild/toolchains/gpsmpi.py index c6a7fd04b8..529d17dc5e 100644 --- a/easybuild/toolchains/gpsmpi.py +++ b/easybuild/toolchains/gpsmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gpsolf.py b/easybuild/toolchains/gpsolf.py index 1414178019..e87f3a5de7 100644 --- a/easybuild/toolchains/gpsolf.py +++ b/easybuild/toolchains/gpsolf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/gqacml.py b/easybuild/toolchains/gqacml.py index 5533bd1f3a..7456b4011e 100644 --- a/easybuild/toolchains/gqacml.py +++ b/easybuild/toolchains/gqacml.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gsmpi.py b/easybuild/toolchains/gsmpi.py index 865dbc813b..68f1a6d0f0 100644 --- a/easybuild/toolchains/gsmpi.py +++ b/easybuild/toolchains/gsmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/gsolf.py b/easybuild/toolchains/gsolf.py index 5d30493bb1..cb917ca7d3 100644 --- a/easybuild/toolchains/gsolf.py +++ b/easybuild/toolchains/gsolf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iccifort.py b/easybuild/toolchains/iccifort.py index d1b6804a93..38ec224a5b 100644 --- a/easybuild/toolchains/iccifort.py +++ b/easybuild/toolchains/iccifort.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iccifortcuda.py b/easybuild/toolchains/iccifortcuda.py index 5f024dc8ce..149cfc8e39 100644 --- a/easybuild/toolchains/iccifortcuda.py +++ b/easybuild/toolchains/iccifortcuda.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/ictce.py b/easybuild/toolchains/ictce.py index 265f249306..2055346b37 100644 --- a/easybuild/toolchains/ictce.py +++ b/easybuild/toolchains/ictce.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/ifbf.py b/easybuild/toolchains/ifbf.py index 3507e1eab9..9f689279cb 100644 --- a/easybuild/toolchains/ifbf.py +++ b/easybuild/toolchains/ifbf.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iibff.py b/easybuild/toolchains/iibff.py index 9fe2b2b0c8..07a6b1e567 100644 --- a/easybuild/toolchains/iibff.py +++ b/easybuild/toolchains/iibff.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iimkl.py b/easybuild/toolchains/iimkl.py index 9d3d6a97f3..605445cc5c 100644 --- a/easybuild/toolchains/iimkl.py +++ b/easybuild/toolchains/iimkl.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iimklc.py b/easybuild/toolchains/iimklc.py index e9508c95ad..89325c2e67 100644 --- a/easybuild/toolchains/iimklc.py +++ b/easybuild/toolchains/iimklc.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iimpi.py b/easybuild/toolchains/iimpi.py index 00d9745a42..9337365ec6 100644 --- a/easybuild/toolchains/iimpi.py +++ b/easybuild/toolchains/iimpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iimpic.py b/easybuild/toolchains/iimpic.py index 53ca437150..45a8df3804 100644 --- a/easybuild/toolchains/iimpic.py +++ b/easybuild/toolchains/iimpic.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iiqmpi.py b/easybuild/toolchains/iiqmpi.py index aee09bb658..5ff1466ff3 100644 --- a/easybuild/toolchains/iiqmpi.py +++ b/easybuild/toolchains/iiqmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/impich.py b/easybuild/toolchains/impich.py index 2b7fba07f9..7feda33805 100644 --- a/easybuild/toolchains/impich.py +++ b/easybuild/toolchains/impich.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/impmkl.py b/easybuild/toolchains/impmkl.py index 1653b31d5c..952bff34ce 100644 --- a/easybuild/toolchains/impmkl.py +++ b/easybuild/toolchains/impmkl.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/intel-para.py b/easybuild/toolchains/intel-para.py index a9d4ca0313..ddfee3aaae 100644 --- a/easybuild/toolchains/intel-para.py +++ b/easybuild/toolchains/intel-para.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/intel.py b/easybuild/toolchains/intel.py index 7dd625588f..659b05faf2 100644 --- a/easybuild/toolchains/intel.py +++ b/easybuild/toolchains/intel.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/intel_compilers.py b/easybuild/toolchains/intel_compilers.py index ab5de03386..27fdfbebfd 100644 --- a/easybuild/toolchains/intel_compilers.py +++ b/easybuild/toolchains/intel_compilers.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/intelcuda.py b/easybuild/toolchains/intelcuda.py index 343715e43b..bdd59abaab 100644 --- a/easybuild/toolchains/intelcuda.py +++ b/easybuild/toolchains/intelcuda.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iofbf.py b/easybuild/toolchains/iofbf.py index 3410ffaf9f..cd3313d600 100644 --- a/easybuild/toolchains/iofbf.py +++ b/easybuild/toolchains/iofbf.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iomkl.py b/easybuild/toolchains/iomkl.py index cefe83c3b1..033277919c 100644 --- a/easybuild/toolchains/iomkl.py +++ b/easybuild/toolchains/iomkl.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iomklc.py b/easybuild/toolchains/iomklc.py index 102fa7a311..f40cd78e16 100644 --- a/easybuild/toolchains/iomklc.py +++ b/easybuild/toolchains/iomklc.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iompi.py b/easybuild/toolchains/iompi.py index 318db78481..b578c45892 100644 --- a/easybuild/toolchains/iompi.py +++ b/easybuild/toolchains/iompi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iompic.py b/easybuild/toolchains/iompic.py index 1bcb2eac71..5b675f5621 100644 --- a/easybuild/toolchains/iompic.py +++ b/easybuild/toolchains/iompic.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/ipsmpi.py b/easybuild/toolchains/ipsmpi.py index 1a381414c3..a8a772adcb 100644 --- a/easybuild/toolchains/ipsmpi.py +++ b/easybuild/toolchains/ipsmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/iqacml.py b/easybuild/toolchains/iqacml.py index fc63968583..e4c5476cd4 100644 --- a/easybuild/toolchains/iqacml.py +++ b/easybuild/toolchains/iqacml.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/ismkl.py b/easybuild/toolchains/ismkl.py index 90ff100eeb..4ccdc87054 100644 --- a/easybuild/toolchains/ismkl.py +++ b/easybuild/toolchains/ismkl.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/__init__.py b/easybuild/toolchains/linalg/__init__.py index 152bae1e3d..90cdb068a8 100644 --- a/easybuild/toolchains/linalg/__init__.py +++ b/easybuild/toolchains/linalg/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/acml.py b/easybuild/toolchains/linalg/acml.py index 47cb13cfe1..1470b1f360 100644 --- a/easybuild/toolchains/linalg/acml.py +++ b/easybuild/toolchains/linalg/acml.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/atlas.py b/easybuild/toolchains/linalg/atlas.py index 4d53f5bd32..bc894bb108 100644 --- a/easybuild/toolchains/linalg/atlas.py +++ b/easybuild/toolchains/linalg/atlas.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/blacs.py b/easybuild/toolchains/linalg/blacs.py index a3963e9daa..201681c51f 100644 --- a/easybuild/toolchains/linalg/blacs.py +++ b/easybuild/toolchains/linalg/blacs.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/blis.py b/easybuild/toolchains/linalg/blis.py index fa607d0527..d89f3b8d83 100644 --- a/easybuild/toolchains/linalg/blis.py +++ b/easybuild/toolchains/linalg/blis.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/flame.py b/easybuild/toolchains/linalg/flame.py index 78ac8f1ca4..5f6f5cfe87 100644 --- a/easybuild/toolchains/linalg/flame.py +++ b/easybuild/toolchains/linalg/flame.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/flexiblas.py b/easybuild/toolchains/linalg/flexiblas.py index 3726e7444f..b994383bb5 100644 --- a/easybuild/toolchains/linalg/flexiblas.py +++ b/easybuild/toolchains/linalg/flexiblas.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/fujitsussl.py b/easybuild/toolchains/linalg/fujitsussl.py index ecaff56683..dde792455b 100644 --- a/easybuild/toolchains/linalg/fujitsussl.py +++ b/easybuild/toolchains/linalg/fujitsussl.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/gotoblas.py b/easybuild/toolchains/linalg/gotoblas.py index 17d98413a8..e8a99a651a 100644 --- a/easybuild/toolchains/linalg/gotoblas.py +++ b/easybuild/toolchains/linalg/gotoblas.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/intelmkl.py b/easybuild/toolchains/linalg/intelmkl.py index 39238654cd..b0bcf2ecd3 100644 --- a/easybuild/toolchains/linalg/intelmkl.py +++ b/easybuild/toolchains/linalg/intelmkl.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/lapack.py b/easybuild/toolchains/linalg/lapack.py index e9821a659d..e26c9e2961 100644 --- a/easybuild/toolchains/linalg/lapack.py +++ b/easybuild/toolchains/linalg/lapack.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/libsci.py b/easybuild/toolchains/linalg/libsci.py index 87c42116f5..07ea64ed82 100644 --- a/easybuild/toolchains/linalg/libsci.py +++ b/easybuild/toolchains/linalg/libsci.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/openblas.py b/easybuild/toolchains/linalg/openblas.py index e28d4f7dd2..18118d1f01 100644 --- a/easybuild/toolchains/linalg/openblas.py +++ b/easybuild/toolchains/linalg/openblas.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/linalg/scalapack.py b/easybuild/toolchains/linalg/scalapack.py index ef4d24ef30..980e3bfdab 100644 --- a/easybuild/toolchains/linalg/scalapack.py +++ b/easybuild/toolchains/linalg/scalapack.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/mpi/__init__.py b/easybuild/toolchains/mpi/__init__.py index aea95e9051..c5abd0f595 100644 --- a/easybuild/toolchains/mpi/__init__.py +++ b/easybuild/toolchains/mpi/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/mpi/craympich.py b/easybuild/toolchains/mpi/craympich.py index 4c62c45519..8eab736d82 100644 --- a/easybuild/toolchains/mpi/craympich.py +++ b/easybuild/toolchains/mpi/craympich.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -53,7 +53,7 @@ class CrayMPICH(Mpi): MPI_COMPILER_MPIFC = CrayPECompiler.COMPILER_FC # no MPI wrappers, so no need to specify serial compiler - MPI_SHARED_OPTION_MAP = dict([('_opt_%s' % var, '') for var, _ in MPI_COMPILER_VARIABLES]) + MPI_SHARED_OPTION_MAP = {'_opt_%s' % var: '' for var, _ in MPI_COMPILER_VARIABLES} def _set_mpi_compiler_variables(self): """Set the MPI compiler variables""" diff --git a/easybuild/toolchains/mpi/fujitsumpi.py b/easybuild/toolchains/mpi/fujitsumpi.py index f81e1d66f0..ad65c463cf 100644 --- a/easybuild/toolchains/mpi/fujitsumpi.py +++ b/easybuild/toolchains/mpi/fujitsumpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -45,7 +45,7 @@ class FujitsuMPI(Mpi): MPI_TYPE = TC_CONSTANT_MPI_TYPE_OPENMPI # OpenMPI reads from CC etc env variables - MPI_SHARED_OPTION_MAP = dict([('_opt_%s' % var, '') for var, _ in MPI_COMPILER_VARIABLES]) + MPI_SHARED_OPTION_MAP = {'_opt_%s' % var: '' for var, _ in MPI_COMPILER_VARIABLES} MPI_LINK_INFO_OPTION = '-showme:link' diff --git a/easybuild/toolchains/mpi/intelmpi.py b/easybuild/toolchains/mpi/intelmpi.py index 6b9f86430a..8bc67fe788 100644 --- a/easybuild/toolchains/mpi/intelmpi.py +++ b/easybuild/toolchains/mpi/intelmpi.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/mpi/mpich.py b/easybuild/toolchains/mpi/mpich.py index b0c42e57d8..7a067a0d37 100644 --- a/easybuild/toolchains/mpi/mpich.py +++ b/easybuild/toolchains/mpi/mpich.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -56,7 +56,7 @@ class Mpich(Mpi): MPI_COMPILER_MPIFC = None # clear MPI wrapper command options - MPI_SHARED_OPTION_MAP = dict([('_opt_%s' % var, '') for var, _ in MPI_COMPILER_VARIABLES]) + MPI_SHARED_OPTION_MAP = {'_opt_%s' % var: '' for var, _ in MPI_COMPILER_VARIABLES} def _set_mpi_compiler_variables(self): """Set the MPICH_{CC, CXX, F77, F90, FC} variables.""" diff --git a/easybuild/toolchains/mpi/mpich2.py b/easybuild/toolchains/mpi/mpich2.py index bd85d30532..b6f1f6f082 100644 --- a/easybuild/toolchains/mpi/mpich2.py +++ b/easybuild/toolchains/mpi/mpich2.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/mpi/mpitrampoline.py b/easybuild/toolchains/mpi/mpitrampoline.py index 5af054661c..43202b59d3 100644 --- a/easybuild/toolchains/mpi/mpitrampoline.py +++ b/easybuild/toolchains/mpi/mpitrampoline.py @@ -1,5 +1,5 @@ ## -# Copyright 2022-2023 Ghent University +# Copyright 2022-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -53,7 +53,7 @@ class MPItrampoline(Mpi): MPI_COMPILER_MPIFC = None # MPItrampoline reads from CC etc env variables - MPI_SHARED_OPTION_MAP = dict([('_opt_%s' % var, '') for var, _ in MPI_COMPILER_VARIABLES]) + MPI_SHARED_OPTION_MAP = {'_opt_%s' % var: '' for var, _ in MPI_COMPILER_VARIABLES} MPI_LINK_INFO_OPTION = '-showme:link' diff --git a/easybuild/toolchains/mpi/mvapich2.py b/easybuild/toolchains/mpi/mvapich2.py index afb2602f44..4f69c970f5 100644 --- a/easybuild/toolchains/mpi/mvapich2.py +++ b/easybuild/toolchains/mpi/mvapich2.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/mpi/openmpi.py b/easybuild/toolchains/mpi/openmpi.py index 630262f48b..91d10923e7 100644 --- a/easybuild/toolchains/mpi/openmpi.py +++ b/easybuild/toolchains/mpi/openmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -61,7 +61,7 @@ class OpenMPI(Mpi): MPI_COMPILER_MPIFC = None # OpenMPI reads from CC etc env variables - MPI_SHARED_OPTION_MAP = dict([('_opt_%s' % var, '') for var, _ in MPI_COMPILER_VARIABLES]) + MPI_SHARED_OPTION_MAP = {'_opt_%s' % var: '' for var, _ in MPI_COMPILER_VARIABLES} MPI_LINK_INFO_OPTION = '-showme:link' diff --git a/easybuild/toolchains/mpi/psmpi.py b/easybuild/toolchains/mpi/psmpi.py index cfbf720a74..07e8c9af78 100644 --- a/easybuild/toolchains/mpi/psmpi.py +++ b/easybuild/toolchains/mpi/psmpi.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/mpi/qlogicmpi.py b/easybuild/toolchains/mpi/qlogicmpi.py index 26c0663756..b7355cd3e1 100644 --- a/easybuild/toolchains/mpi/qlogicmpi.py +++ b/easybuild/toolchains/mpi/qlogicmpi.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/mpi/spectrummpi.py b/easybuild/toolchains/mpi/spectrummpi.py index e0d4b2f530..1fee1d51b7 100644 --- a/easybuild/toolchains/mpi/spectrummpi.py +++ b/easybuild/toolchains/mpi/spectrummpi.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/nvhpc.py b/easybuild/toolchains/nvhpc.py index aca69d386f..b4b871f84f 100644 --- a/easybuild/toolchains/nvhpc.py +++ b/easybuild/toolchains/nvhpc.py @@ -1,5 +1,5 @@ ## -# Copyright 2015 Bart Oldeman +# Copyright 2015-2024 Bart Oldeman # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/nvofbf.py b/easybuild/toolchains/nvofbf.py index 41e89e5a32..62d3cb4d37 100644 --- a/easybuild/toolchains/nvofbf.py +++ b/easybuild/toolchains/nvofbf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/nvompi.py b/easybuild/toolchains/nvompi.py index 5f2e25f03d..3feedaae35 100644 --- a/easybuild/toolchains/nvompi.py +++ b/easybuild/toolchains/nvompi.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2021 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/nvompic.py b/easybuild/toolchains/nvompic.py index e4ac0d6106..b9c5abc298 100644 --- a/easybuild/toolchains/nvompic.py +++ b/easybuild/toolchains/nvompic.py @@ -1,6 +1,6 @@ ## -# Copyright 2016-2023 Ghent University -# Copyright 2016-2023 Forschungszentrum Juelich +# Copyright 2016-2024 Ghent University +# Copyright 2016-2024 Forschungszentrum Juelich # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/nvpsmpi.py b/easybuild/toolchains/nvpsmpi.py index 9e102c9d53..cbaee42bc0 100644 --- a/easybuild/toolchains/nvpsmpi.py +++ b/easybuild/toolchains/nvpsmpi.py @@ -1,6 +1,6 @@ ## -# Copyright 2016-2021 Ghent University -# Copyright 2016-2021 Forschungszentrum Juelich +# Copyright 2016-2024 Ghent University +# Copyright 2016-2024 Forschungszentrum Juelich # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/nvpsmpic.py b/easybuild/toolchains/nvpsmpic.py index 604630ff8e..0b916c30a0 100644 --- a/easybuild/toolchains/nvpsmpic.py +++ b/easybuild/toolchains/nvpsmpic.py @@ -1,6 +1,6 @@ ## -# Copyright 2016-2023 Ghent University -# Copyright 2016-2023 Forschungszentrum Juelich +# Copyright 2016-2024 Ghent University +# Copyright 2016-2024 Forschungszentrum Juelich # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/pgi.py b/easybuild/toolchains/pgi.py index 2ee3dc3839..df2258bda4 100644 --- a/easybuild/toolchains/pgi.py +++ b/easybuild/toolchains/pgi.py @@ -1,5 +1,5 @@ ## -# Copyright 2015 Bart Oldeman +# Copyright 2015-2024 Bart Oldeman # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/toolchains/pmkl.py b/easybuild/toolchains/pmkl.py index a4ad73d7cd..8b22d1d35f 100644 --- a/easybuild/toolchains/pmkl.py +++ b/easybuild/toolchains/pmkl.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/pomkl.py b/easybuild/toolchains/pomkl.py index ea85e2d440..f28f445296 100644 --- a/easybuild/toolchains/pomkl.py +++ b/easybuild/toolchains/pomkl.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/pompi.py b/easybuild/toolchains/pompi.py index f8a9e00039..9de2e52050 100644 --- a/easybuild/toolchains/pompi.py +++ b/easybuild/toolchains/pompi.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/toolchains/system.py b/easybuild/toolchains/system.py index cfb46a93b2..8a8b17cfaa 100644 --- a/easybuild/toolchains/system.py +++ b/easybuild/toolchains/system.py @@ -1,5 +1,5 @@ ## -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/__init__.py b/easybuild/tools/__init__.py index cc7eadb99f..8968a12699 100644 --- a/easybuild/tools/__init__.py +++ b/easybuild/tools/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/asyncprocess.py b/easybuild/tools/asyncprocess.py index b3a7d330ff..0a3c133fc4 100644 --- a/easybuild/tools/asyncprocess.py +++ b/easybuild/tools/asyncprocess.py @@ -1,6 +1,6 @@ ## # Copyright 2005 Josiah Carlson -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # The Asynchronous Python Subprocess recipe was originally created by Josiah Carlson. # and released under the GPL v2 on March 14, 2012 diff --git a/easybuild/tools/build_details.py b/easybuild/tools/build_details.py index 9cd2f0c88c..f5ce1ebc01 100644 --- a/easybuild/tools/build_details.py +++ b/easybuild/tools/build_details.py @@ -1,4 +1,4 @@ -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/build_log.py b/easybuild/tools/build_log.py index 04bcaae16c..2e2bf726c0 100644 --- a/easybuild/tools/build_log.py +++ b/easybuild/tools/build_log.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/config.py b/easybuild/tools/config.py index ecd503ba1a..9791eb3dcc 100644 --- a/easybuild/tools/config.py +++ b/easybuild/tools/config.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -221,6 +221,7 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX): 'filter_env_vars', 'filter_rpath_sanity_libs', 'force_download', + 'from_commit', 'git_working_dirs_path', 'github_user', 'github_org', @@ -230,6 +231,7 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX): 'http_header_fields_urlpat', 'hooks', 'ignore_dirs', + 'include_easyblocks_from_commit', 'insecure_download', 'job_backend_config', 'job_cores', @@ -307,6 +309,7 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX): 'skip_test_cases', 'skip_test_step', 'sticky_bit', + 'terse', 'unit_testing_mode', 'upload_test_report', 'update_modules_tool_cache', @@ -403,7 +406,7 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX): 'build_specs', 'command_line', 'external_modules_metadata', - 'pr_paths', + 'extra_ec_paths', 'robot_path', 'valid_module_classes', 'valid_stops', @@ -570,7 +573,7 @@ def init_build_options(build_options=None, cmdline_options=None): cmdline_options.ignore_osdeps = True cmdline_build_option_names = [k for ks in BUILD_OPTIONS_CMDLINE.values() for k in ks] - active_build_options.update(dict([(key, getattr(cmdline_options, key)) for key in cmdline_build_option_names])) + active_build_options.update({key: getattr(cmdline_options, key) for key in cmdline_build_option_names}) # other options which can be derived but have no perfectly matching cmdline option active_build_options.update({ 'check_osdeps': not cmdline_options.ignore_osdeps, @@ -593,7 +596,7 @@ def init_build_options(build_options=None, cmdline_options=None): for opt in build_options_by_default[default]: bo[opt] = [] else: - bo.update(dict([(opt, default) for opt in build_options_by_default[default]])) + bo.update({opt: default for opt in build_options_by_default[default]}) bo.update(active_build_options) # BuildOptions is a singleton, so any future calls to BuildOptions will yield the same instance diff --git a/easybuild/tools/containers/__init__.py b/easybuild/tools/containers/__init__.py index 76cb37219a..215ba61c0c 100644 --- a/easybuild/tools/containers/__init__.py +++ b/easybuild/tools/containers/__init__.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/containers/apptainer.py b/easybuild/tools/containers/apptainer.py index 8a294ce1ad..690cdd52a2 100644 --- a/easybuild/tools/containers/apptainer.py +++ b/easybuild/tools/containers/apptainer.py @@ -1,4 +1,4 @@ -# Copyright 2022-2023 Ghent University +# Copyright 2022-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/containers/base.py b/easybuild/tools/containers/base.py index 68a49610d3..faf3b0cc7a 100644 --- a/easybuild/tools/containers/base.py +++ b/easybuild/tools/containers/base.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/containers/common.py b/easybuild/tools/containers/common.py index bcbdce9a9b..6824c16864 100644 --- a/easybuild/tools/containers/common.py +++ b/easybuild/tools/containers/common.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/containers/docker.py b/easybuild/tools/containers/docker.py index 5a1597d634..1308ac57db 100644 --- a/easybuild/tools/containers/docker.py +++ b/easybuild/tools/containers/docker.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/containers/singularity.py b/easybuild/tools/containers/singularity.py index 638a985ae5..be8573f8c9 100644 --- a/easybuild/tools/containers/singularity.py +++ b/easybuild/tools/containers/singularity.py @@ -1,4 +1,4 @@ -# Copyright 2017-2023 Ghent University +# Copyright 2017-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/containers/utils.py b/easybuild/tools/containers/utils.py index d543ca77fc..f2ae68d133 100644 --- a/easybuild/tools/containers/utils.py +++ b/easybuild/tools/containers/utils.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/convert.py b/easybuild/tools/convert.py index 9a675850f9..98d3b63711 100644 --- a/easybuild/tools/convert.py +++ b/easybuild/tools/convert.py @@ -1,5 +1,5 @@ # # -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/docs.py b/easybuild/tools/docs.py index 5a41090166..42d88616f0 100644 --- a/easybuild/tools/docs.py +++ b/easybuild/tools/docs.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -1092,11 +1092,9 @@ def list_toolchains(output_format=FORMAT_TXT): """Show list of known toolchains.""" _, all_tcs = search_toolchain('') - all_tcs = [x for x in all_tcs] - all_tcs_names = [x.NAME for x in all_tcs] - # start with dict that maps toolchain name to corresponding subclass of Toolchain - tcs = dict(zip(all_tcs_names, all_tcs)) + # filter deprecated 'dummy' toolchain + tcs = {tc.NAME: tc for tc in all_tcs} for tcname in sorted(tcs): tcc = tcs[tcname] diff --git a/easybuild/tools/environment.py b/easybuild/tools/environment.py index d68755ff24..a5cc708ce2 100644 --- a/easybuild/tools/environment.py +++ b/easybuild/tools/environment.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -83,9 +83,9 @@ def setvar(key, value, verbose=True): :param verbose: include message in dry run output for defining this environment variable """ - if key in os.environ: + try: oldval_info = "previous value: '%s'" % os.environ[key] - else: + except KeyError: oldval_info = "previously undefined" # os.putenv() is not necessary. os.environ will call this. os.environ[key] = value @@ -136,7 +136,7 @@ def read_environment(env_vars, strict=False): :param env_vars: a dict with key a name, value a environment variable name :param strict: boolean, if True enforces that all specified environment variables are found """ - result = dict([(k, os.environ.get(v)) for k, v in env_vars.items() if v in os.environ]) + result = {k: os.environ.get(v) for k, v in env_vars.items() if v in os.environ} if not len(env_vars) == len(result): missing = ','.join(["%s / %s" % (k, v) for k, v in env_vars.items() if k not in result]) diff --git a/easybuild/tools/filetools.py b/easybuild/tools/filetools.py index e49a60c399..25813b43be 100644 --- a/easybuild/tools/filetools.py +++ b/easybuild/tools/filetools.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -954,11 +954,12 @@ def load_index(path, ignore_dirs=None): # check whether index is still valid if valid_ts: curr_ts = datetime.datetime.now() + terse = build_option('terse') if curr_ts > valid_ts: - print_warning("Index for %s is no longer valid (too old), so ignoring it...", path) + print_warning("Index for %s is no longer valid (too old), so ignoring it...", path, silent=terse) index = None else: - print_msg("found valid index for %s, so using it...", path) + print_msg("found valid index for %s, so using it...", path, silent=terse) return index or None diff --git a/easybuild/tools/github.py b/easybuild/tools/github.py index f366985b7f..3bcc99b83c 100644 --- a/easybuild/tools/github.py +++ b/easybuild/tools/github.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -56,7 +56,7 @@ from easybuild.tools import LooseVersion from easybuild.tools.build_log import EasyBuildError, print_msg, print_warning from easybuild.tools.config import build_option -from easybuild.tools.filetools import apply_patch, copy_dir, copy_easyblocks, copy_framework_files +from easybuild.tools.filetools import apply_patch, copy_dir, copy_easyblocks, copy_file, copy_framework_files from easybuild.tools.filetools import det_patched_files, download_file, extract_file from easybuild.tools.filetools import get_easyblock_class_name, mkdir, read_file, symlink, which, write_file from easybuild.tools.systemtools import UNKNOWN, get_tool_version @@ -356,16 +356,18 @@ def fetch_latest_commit_sha(repo, account, branch=None, github_user=None, token= return res -def download_repo(repo=GITHUB_EASYCONFIGS_REPO, branch=None, account=GITHUB_EB_MAIN, path=None, github_user=None): +def download_repo(repo=GITHUB_EASYCONFIGS_REPO, branch=None, commit=None, account=GITHUB_EB_MAIN, path=None, + github_user=None): """ Download entire GitHub repo as a tar.gz archive, and extract it into specified path. :param repo: repo to download :param branch: branch to download + :param commit: commit to download :param account: GitHub account to download repo from :param path: path to extract to :param github_user: name of GitHub user to use """ - if branch is None: + if branch is None and commit is None: branch = pick_default_branch(account) # make sure path exists, create it if necessary @@ -376,9 +378,25 @@ def download_repo(repo=GITHUB_EASYCONFIGS_REPO, branch=None, account=GITHUB_EB_M path = os.path.join(path, account) mkdir(path, parents=True) - extracted_dir_name = '%s-%s' % (repo, branch) - base_name = '%s.tar.gz' % branch - latest_commit_sha = fetch_latest_commit_sha(repo, account, branch, github_user=github_user) + if commit: + # make sure that full commit SHA is provided + commit_sha1_regex = re.compile('[0-9a-f]{40}') + if commit_sha1_regex.match(commit): + _log.info("Valid commit SHA provided for downloading %s/%s: %s", account, repo, commit) + else: + error_msg = r"Specified commit SHA %s for downloading %s/%s is not valid, " + error_msg += "must be full SHA-1 (40 chars)" + raise EasyBuildError(error_msg, commit, account, repo) + + extracted_dir_name = '%s-%s' % (repo, commit) + base_name = '%s.tar.gz' % commit + latest_commit_sha = commit + elif branch: + extracted_dir_name = '%s-%s' % (repo, branch) + base_name = '%s.tar.gz' % branch + latest_commit_sha = fetch_latest_commit_sha(repo, account, branch, github_user=github_user) + else: + raise EasyBuildError("Either branch or commit should be specified in download_repo") expected_path = os.path.join(path, extracted_dir_name) latest_sha_path = os.path.join(expected_path, 'latest-sha') @@ -394,19 +412,33 @@ def download_repo(repo=GITHUB_EASYCONFIGS_REPO, branch=None, account=GITHUB_EB_M target_path = os.path.join(path, base_name) _log.debug("downloading repo %s/%s as archive from %s to %s" % (account, repo, url, target_path)) - download_file(base_name, url, target_path, forced=True, trace=False) - _log.debug("%s downloaded to %s, extracting now" % (base_name, path)) + downloaded_path = download_file(base_name, url, target_path, forced=True, trace=False) + if downloaded_path is None: + raise EasyBuildError("Failed to download tarball for %s/%s commit %s", account, repo, commit) + else: + _log.debug("%s downloaded to %s, extracting now", base_name, path) base_dir = extract_file(target_path, path, forced=True, change_into_dir=False, trace=False) extracted_path = os.path.join(base_dir, extracted_dir_name) # check if extracted_path exists if not os.path.isdir(extracted_path): - raise EasyBuildError("%s should exist and contain the repo %s at branch %s", extracted_path, repo, branch) + error_msg = "%s should exist and contain the repo %s " % (extracted_path, repo) + if branch: + error_msg += "at branch " + branch + elif commit: + error_msg += "at commit " + commit + raise EasyBuildError(error_msg) write_file(latest_sha_path, latest_commit_sha, forced=True) - _log.debug("Repo %s at branch %s extracted into %s" % (repo, branch, extracted_path)) + log_msg = "Repo %s at %%s extracted into %s" % (repo, extracted_path) + if branch: + log_msg = log_msg % ('branch ' + branch) + elif commit: + log_msg = log_msg % ('commit ' + commit) + _log.debug(log_msg) + return extracted_path @@ -451,14 +483,15 @@ def fetch_files_from_pr(pr, path=None, github_user=None, github_account=None, gi if path is None: if github_repo == GITHUB_EASYCONFIGS_REPO: - pr_paths = build_option('pr_paths') - if pr_paths: + extra_ec_paths = build_option('extra_ec_paths') + if extra_ec_paths: # figure out directory for this specific PR (see also alt_easyconfig_paths) - cands = [p for p in pr_paths if p.endswith('files_pr%s' % pr)] + cands = [p for p in extra_ec_paths if p.endswith('files_pr%s' % pr)] if len(cands) == 1: path = cands[0] else: - raise EasyBuildError("Failed to isolate path for PR #%s from list of PR paths: %s", pr, pr_paths) + raise EasyBuildError("Failed to isolate path for PR #%s from list of PR paths: %s", + pr, extra_ec_paths) elif github_repo == GITHUB_EASYBLOCKS_REPO: path = os.path.join(tempfile.gettempdir(), 'ebs_pr%s' % pr) @@ -559,7 +592,7 @@ def fetch_files_from_pr(pr, path=None, github_user=None, github_account=None, gi def fetch_easyblocks_from_pr(pr, path=None, github_user=None): - """Fetch patched easyconfig files for a particular PR.""" + """Fetch patched easyblocks for a particular PR.""" return fetch_files_from_pr(pr, path, github_user, github_repo=GITHUB_EASYBLOCKS_REPO) @@ -568,6 +601,102 @@ def fetch_easyconfigs_from_pr(pr, path=None, github_user=None): return fetch_files_from_pr(pr, path, github_user, github_repo=GITHUB_EASYCONFIGS_REPO) +def fetch_files_from_commit(commit, files=None, path=None, github_account=None, github_repo=None): + """ + Fetch files from a specific commit. + + If 'files' is None, all files touched in the commit are used. + """ + if github_account is None: + github_account = build_option('pr_target_account') + + if github_repo is None: + github_repo = GITHUB_EASYCONFIGS_REPO + + if path is None: + if github_repo == GITHUB_EASYCONFIGS_REPO: + extra_ec_paths = build_option('extra_ec_paths') + if extra_ec_paths: + # figure out directory for this specific commit (see also alt_easyconfig_paths) + cands = [p for p in extra_ec_paths if p.endswith('files_commit_' + commit)] + if len(cands) == 1: + path = cands[0] + else: + raise EasyBuildError("Failed to isolate path for commit %s from list of commit paths: %s", + commit, extra_ec_paths) + else: + path = os.path.join(tempfile.gettempdir(), 'ecs_commit_' + commit) + + elif github_repo == GITHUB_EASYBLOCKS_REPO: + path = os.path.join(tempfile.gettempdir(), 'ebs_commit_' + commit) + else: + raise EasyBuildError("Unknown repo: %s" % github_repo) + + # if no files are specified, determine which files are touched in commit + if not files: + diff_url = os.path.join(GITHUB_URL, github_account, github_repo, 'commit', commit + '.diff') + diff_fn = os.path.basename(diff_url) + diff_filepath = os.path.join(path, diff_fn) + if download_file(diff_fn, diff_url, diff_filepath, forced=True): + diff_txt = read_file(diff_filepath) + _log.debug("Diff for commit %s:\n%s", commit, diff_txt) + + files = det_patched_files(txt=diff_txt, omit_ab_prefix=True, github=True, filter_deleted=True) + _log.debug("List of patched files for commit %s: %s", commit, files) + else: + raise EasyBuildError("Failed to download diff for commit %s of %s/%s", commit, github_account, github_repo) + + # download tarball for specific commit + repo_commit = download_repo(repo=github_repo, commit=commit, account=github_account) + + if github_repo == GITHUB_EASYCONFIGS_REPO: + files_subdir = 'easybuild/easyconfigs/' + elif github_repo == GITHUB_EASYBLOCKS_REPO: + files_subdir = 'easybuild/easyblocks/' + else: + raise EasyBuildError("Unknown repo: %s" % github_repo) + + # copy specified files to directory where they're expected to be found + file_paths = [] + for file in files: + + # if only filename is specified, we need to determine the file path + if file == os.path.basename(file): + src_path = None + for (dirpath, _, filenames) in os.walk(repo_commit, topdown=True): + if file in filenames: + src_path = os.path.join(dirpath, file) + break + else: + src_path = os.path.join(repo_commit, file) + + # strip of leading subdirectory like easybuild/easyconfigs/ or easybuild/easyblocks/ + # because that's what expected by robot_find_easyconfig + if file.startswith(files_subdir): + file = file[len(files_subdir):] + + # if file is found, copy it to dedicated directory; + # if not, just skip it (may be an easyconfig file in local directory); + if src_path and os.path.exists(src_path): + target_path = os.path.join(path, file) + copy_file(src_path, target_path) + file_paths.append(target_path) + else: + _log.info("File %s not found in %s, so ignoring it...", file, repo_commit) + + return file_paths + + +def fetch_easyblocks_from_commit(commit, files=None, path=None): + """Fetch easyblocks from a specified commit.""" + return fetch_files_from_commit(commit, files=files, path=path, github_repo=GITHUB_EASYBLOCKS_REPO) + + +def fetch_easyconfigs_from_commit(commit, files=None, path=None): + """Fetch specified easyconfig files from a specific commit.""" + return fetch_files_from_commit(commit, files=files, path=path, github_repo=GITHUB_EASYCONFIGS_REPO) + + def create_gist(txt, fn, descr=None, github_user=None, github_token=None): """Create a gist with the provided text.""" diff --git a/easybuild/tools/hooks.py b/easybuild/tools/hooks.py index 2bb329027b..b114224f95 100644 --- a/easybuild/tools/hooks.py +++ b/easybuild/tools/hooks.py @@ -1,5 +1,5 @@ # # -# Copyright 2017-2023 Ghent University +# Copyright 2017-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/include.py b/easybuild/tools/include.py index 3898facd4c..0171d74f10 100644 --- a/easybuild/tools/include.py +++ b/easybuild/tools/include.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # # -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/jenkins.py b/easybuild/tools/jenkins.py index 3c00d3961c..50ee563083 100644 --- a/easybuild/tools/jenkins.py +++ b/easybuild/tools/jenkins.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/job/backend.py b/easybuild/tools/job/backend.py index c92ead6a58..1219883740 100644 --- a/easybuild/tools/job/backend.py +++ b/easybuild/tools/job/backend.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -104,7 +104,7 @@ def avail_job_backends(check_usable=True): Return all known job execution backends. """ import_available_modules('easybuild.tools.job') - class_dict = dict([(x.__name__, x) for x in get_subclasses(JobBackend)]) + class_dict = {x.__name__: x for x in get_subclasses(JobBackend)} return class_dict diff --git a/easybuild/tools/job/gc3pie.py b/easybuild/tools/job/gc3pie.py index 005cff2e90..f6b57e0f2c 100644 --- a/easybuild/tools/job/gc3pie.py +++ b/easybuild/tools/job/gc3pie.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # Copyright 2015 S3IT, University of Zurich # # This file is part of EasyBuild, diff --git a/easybuild/tools/job/pbs_python.py b/easybuild/tools/job/pbs_python.py index a4a020988e..bf90b57063 100644 --- a/easybuild/tools/job/pbs_python.py +++ b/easybuild/tools/job/pbs_python.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -484,7 +484,7 @@ def info(self, types=None): # only expect to have a list with one element j = jobs[0] # convert attribs into useable dict - job_details = dict([(attrib.name, attrib.value) for attrib in j.attribs]) + job_details = {attrib.name: attrib.value for attrib in j.attribs} # manually set 'id' attribute job_details['id'] = j.name self.log.debug("Found jobinfo %s" % job_details) diff --git a/easybuild/tools/job/slurm.py b/easybuild/tools/job/slurm.py index 97a925bd35..517deff56d 100644 --- a/easybuild/tools/job/slurm.py +++ b/easybuild/tools/job/slurm.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/module_generator.py b/easybuild/tools/module_generator.py index 851d4131ff..c537003de5 100644 --- a/easybuild/tools/module_generator.py +++ b/easybuild/tools/module_generator.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -58,7 +58,7 @@ def avail_module_generators(): """ Return all known module syntaxes. """ - return dict([(k.SYNTAX, k) for k in get_subclasses(ModuleGenerator)]) + return {k.SYNTAX: k for k in get_subclasses(ModuleGenerator)} def module_generator(app, fake=False): diff --git a/easybuild/tools/module_naming_scheme/__init__.py b/easybuild/tools/module_naming_scheme/__init__.py index bea5d52dc5..e54f04c31e 100644 --- a/easybuild/tools/module_naming_scheme/__init__.py +++ b/easybuild/tools/module_naming_scheme/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2011-2023 Ghent University +# Copyright 2011-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/module_naming_scheme/categorized_mns.py b/easybuild/tools/module_naming_scheme/categorized_mns.py index 616baf19c2..cdafc97cbb 100644 --- a/easybuild/tools/module_naming_scheme/categorized_mns.py +++ b/easybuild/tools/module_naming_scheme/categorized_mns.py @@ -1,5 +1,5 @@ ## -# Copyright 2016-2023 Ghent University +# Copyright 2016-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/module_naming_scheme/easybuild_mns.py b/easybuild/tools/module_naming_scheme/easybuild_mns.py index c12ae9a614..93ff663e77 100644 --- a/easybuild/tools/module_naming_scheme/easybuild_mns.py +++ b/easybuild/tools/module_naming_scheme/easybuild_mns.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/module_naming_scheme/hierarchical_mns.py b/easybuild/tools/module_naming_scheme/hierarchical_mns.py index 9f2e026eb8..d0e4ea5966 100644 --- a/easybuild/tools/module_naming_scheme/hierarchical_mns.py +++ b/easybuild/tools/module_naming_scheme/hierarchical_mns.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -120,7 +120,7 @@ def det_toolchain_compilers_name_version(self, tc_comps): res = None else: if len(tc_comps) > 0 and tc_comps[0]: - comp_versions = dict([(comp['name'], self.det_full_version(comp)) for comp in tc_comps]) + comp_versions = {comp['name']: self.det_full_version(comp) for comp in tc_comps} comp_names = comp_versions.keys() key = ','.join(sorted(comp_names)) if key in COMP_NAME_VERSION_TEMPLATES: diff --git a/easybuild/tools/module_naming_scheme/migrate_from_eb_to_hmns.py b/easybuild/tools/module_naming_scheme/migrate_from_eb_to_hmns.py index 8d0c34297f..5603b7db47 100644 --- a/easybuild/tools/module_naming_scheme/migrate_from_eb_to_hmns.py +++ b/easybuild/tools/module_naming_scheme/migrate_from_eb_to_hmns.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/module_naming_scheme/mns.py b/easybuild/tools/module_naming_scheme/mns.py index 0da1c142e3..f282a8c8d8 100644 --- a/easybuild/tools/module_naming_scheme/mns.py +++ b/easybuild/tools/module_naming_scheme/mns.py @@ -1,5 +1,5 @@ ## -# Copyright 2011-2023 Ghent University +# Copyright 2011-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/module_naming_scheme/toolchain.py b/easybuild/tools/module_naming_scheme/toolchain.py index 135d996ffb..b85032e6e6 100644 --- a/easybuild/tools/module_naming_scheme/toolchain.py +++ b/easybuild/tools/module_naming_scheme/toolchain.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/module_naming_scheme/utilities.py b/easybuild/tools/module_naming_scheme/utilities.py index e6dac41654..b20c8f394b 100644 --- a/easybuild/tools/module_naming_scheme/utilities.py +++ b/easybuild/tools/module_naming_scheme/utilities.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -85,7 +85,7 @@ def avail_module_naming_schemes(): import_available_modules('easybuild.tools.module_naming_scheme') # construct name-to-class dict of available module naming scheme - avail_mnss = dict([(x.__name__, x) for x in get_subclasses(ModuleNamingScheme)]) + avail_mnss = {x.__name__: x for x in get_subclasses(ModuleNamingScheme)} return avail_mnss diff --git a/easybuild/tools/modules.py b/easybuild/tools/modules.py index a301679b90..0172770363 100644 --- a/easybuild/tools/modules.py +++ b/easybuild/tools/modules.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -295,9 +295,9 @@ def check_module_function(self, allow_mismatch=False, regex=None): """Check whether selected module tool matches 'module' function definition.""" if self.testing: # grab 'module' function definition from environment if it's there; only during testing - if 'module' in os.environ: + try: output, exit_code = os.environ['module'], 0 - else: + except KeyError: output, exit_code = None, 1 else: cmd = "type module" @@ -835,6 +835,8 @@ def run_module(self, *args, **kwargs): # this needs to be taken into account when updating the environment via produced output, see below # keep track of current values of select env vars, so we can correct the adjusted values below + # Identical to `{key: os.environ.get(key, '').split(os.pathsep)[::-1] for key in LD_ENV_VAR_KEYS}` + # but Python 2 treats that as a local function and refused the `exec` below prev_ld_values = dict([(key, os.environ.get(key, '').split(os.pathsep)[::-1]) for key in LD_ENV_VAR_KEYS]) # Change the environment @@ -1110,7 +1112,7 @@ def path_to_top_of_module_tree(self, top_paths, mod_name, full_mod_subdir, deps, if modpath_exts is None: # only retain dependencies that have a non-empty lists of $MODULEPATH extensions - modpath_exts = dict([(k, v) for k, v in self.modpath_extensions_for(deps).items() if v]) + modpath_exts = {k: v for k, v in self.modpath_extensions_for(deps).items() if v} self.log.debug("Non-empty lists of module path extensions for dependencies: %s" % modpath_exts) mods_to_top = [] @@ -1141,7 +1143,7 @@ def path_to_top_of_module_tree(self, top_paths, mod_name, full_mod_subdir, deps, path = mods_to_top[:] if mods_to_top: # remove retained dependencies from the list, since we're climbing up the module tree - remaining_modpath_exts = dict([m for m in modpath_exts.items() if not m[0] in mods_to_top]) + remaining_modpath_exts = {m: v for m, v in modpath_exts.items() if m not in mods_to_top} self.log.debug("Path to top from %s extended to %s, so recursing to find way to the top", mod_name, mods_to_top) @@ -1638,9 +1640,7 @@ def get_software_root(name, with_env_var=False): """ env_var = get_software_root_env_var_name(name) - root = None - if env_var in os.environ: - root = os.getenv(env_var) + root = os.getenv(env_var) if with_env_var: res = (root, env_var) @@ -1708,9 +1708,7 @@ def get_software_version(name): """ env_var = get_software_version_env_var_name(name) - version = None - if env_var in os.environ: - version = os.getenv(env_var) + version = os.getenv(env_var) return version @@ -1739,7 +1737,7 @@ def avail_modules_tools(): """ Return all known modules tools. """ - class_dict = dict([(x.__name__, x) for x in get_subclasses(ModulesTool)]) + class_dict = {x.__name__: x for x in get_subclasses(ModulesTool)} # filter out legacy Modules class if 'Modules' in class_dict: del class_dict['Modules'] diff --git a/easybuild/tools/multidiff.py b/easybuild/tools/multidiff.py index 0f8c7f5bac..99ee949e56 100644 --- a/easybuild/tools/multidiff.py +++ b/easybuild/tools/multidiff.py @@ -1,5 +1,5 @@ # # -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/options.py b/easybuild/tools/options.py index 73744c0ddc..54e9b81982 100644 --- a/easybuild/tools/options.py +++ b/easybuild/tools/options.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -89,7 +89,7 @@ from easybuild.tools.github import GITHUB_PR_DIRECTION_DESC, GITHUB_PR_ORDER_CREATED from easybuild.tools.github import GITHUB_PR_STATE_OPEN, GITHUB_PR_STATES, GITHUB_PR_ORDERS, GITHUB_PR_DIRECTIONS from easybuild.tools.github import HAVE_GITHUB_API, HAVE_KEYRING, VALID_CLOSE_PR_REASONS -from easybuild.tools.github import fetch_easyblocks_from_pr, fetch_github_token +from easybuild.tools.github import fetch_easyblocks_from_commit, fetch_easyblocks_from_pr, fetch_github_token from easybuild.tools.hooks import KNOWN_HOOKS from easybuild.tools.include import include_easyblocks, include_module_naming_schemes, include_toolchains from easybuild.tools.job.backend import avail_job_backends @@ -245,7 +245,7 @@ def __init__(self, *args, **kwargs): # update or define go_configfiles_initenv in named arguments to pass to parent constructor go_cfg_initenv = kwargs.setdefault('go_configfiles_initenv', {}) for section, constants in self.go_cfg_constants.items(): - constants = dict([(name, value) for (name, (value, _)) in constants.items()]) + constants = {name: value for name, (value, _) in constants.items()} go_cfg_initenv.setdefault(section, {}).update(constants) super(EasyBuildOptions, self).__init__(*args, **kwargs) @@ -696,10 +696,14 @@ def github_options(self): 'check-style': ("Run a style check on the given easyconfigs", None, 'store_true', False), 'cleanup-easyconfigs': ("Clean up easyconfig files for pull request", None, 'store_true', True), 'dump-test-report': ("Dump test report to specified path", None, 'store_or_None', 'test_report.md'), + 'from-commit': ("Obtain easyconfigs from specified commit", 'str', 'store', + None, {'metavar': 'commit_SHA'}), 'from-pr': ("Obtain easyconfigs from specified PR", 'strlist', 'store', [], {'metavar': 'PR#'}), 'git-working-dirs-path': ("Path to Git working directories for EasyBuild repositories", str, 'store', None), 'github-user': ("GitHub username", str, 'store', None), 'github-org': ("GitHub organization", str, 'store', None), + 'include-easyblocks-from-commit': ("Include easyblocks from specified commit", 'str', 'store', None, + {'metavar': 'commit_SHA'}), 'include-easyblocks-from-pr': ("Include easyblocks from specified PR", 'strlist', 'store', [], {'metavar': 'PR#'}), 'install-github-token': ("Install GitHub token (requires --github-user)", None, 'store_true', False), @@ -1218,8 +1222,9 @@ def _postprocess_list_avail(self): if self.options.avail_easyconfig_licenses: msg += avail_easyconfig_licenses(self.options.output_format) - # dump available easyblocks (unless including easyblocks from pr, in which case it will be done later) - if self.options.list_easyblocks and not self.options.include_easyblocks_from_pr: + # dump available easyblocks (unless including easyblocks from commit or PR, in which case it will be done later) + easyblocks_from = self.options.include_easyblocks_from_commit or self.options.include_easyblocks_from_pr + if self.options.list_easyblocks and not easyblocks_from: msg += list_easyblocks(self.options.list_easyblocks, self.options.output_format) # dump known toolchains @@ -1263,7 +1268,7 @@ def _postprocess_list_avail(self): print(msg) # cleanup tmpdir and exit - if not self.options.include_easyblocks_from_pr: + if not (self.options.include_easyblocks_from_commit or self.options.include_easyblocks_from_pr): cleanup_and_exit(self.tmpdir) def avail_repositories(self): @@ -1501,6 +1506,19 @@ def parse_options(args=None, with_include=True): return eb_go +def check_options(options): + """ + Check configuration options, some combinations are not allowed. + """ + if options.from_commit and options.from_pr: + raise EasyBuildError("--from-commit and --from-pr should not be used together, pick one") + + if options.include_easyblocks_from_commit and options.include_easyblocks_from_pr: + error_msg = "--include-easyblocks-from-commit and --include-easyblocks-from-pr " + error_msg += "should not be used together, pick one" + raise EasyBuildError(error_msg) + + def check_root_usage(allow_use_as_root=False): """ Check whether we are running as root, and act accordingly @@ -1518,6 +1536,69 @@ def check_root_usage(allow_use_as_root=False): "so let's end this here.") +def handle_include_easyblocks_from(options, log): + """ + Handle --include-easyblocks-from-pr and --include-easyblocks-from-commit + """ + def check_included_multiple(included_easyblocks_from, source): + """Check whether easyblock is being included multiple times""" + included_multiple = included_easyblocks_from & included_easyblocks + if included_multiple: + warning_msg = "One or more easyblocks included from multiple locations: %s " \ + % ', '.join(included_multiple) + warning_msg += "(the one(s) from %s will be used)" % source + print_warning(warning_msg) + + if options.include_easyblocks_from_pr or options.include_easyblocks_from_commit: + + if options.include_easyblocks: + # check if you are including the same easyblock twice + included_paths = expand_glob_paths(options.include_easyblocks) + included_easyblocks = set([os.path.basename(eb) for eb in included_paths]) + + if options.include_easyblocks_from_pr: + try: + easyblock_prs = [int(x) for x in options.include_easyblocks_from_pr] + except ValueError: + raise EasyBuildError("Argument to --include-easyblocks-from-pr must be a comma separated list of PR #s") + + for easyblock_pr in easyblock_prs: + easyblocks_from_pr = fetch_easyblocks_from_pr(easyblock_pr) + included_from_pr = set([os.path.basename(eb) for eb in easyblocks_from_pr]) + + if options.include_easyblocks: + check_included_multiple(included_from_pr, "PR #%s" % easyblock_pr) + included_easyblocks |= included_from_pr + + for easyblock in included_from_pr: + print_msg("easyblock %s included from PR #%s" % (easyblock, easyblock_pr), log=log) + + include_easyblocks(options.tmpdir, easyblocks_from_pr) + + easyblock_commit = options.include_easyblocks_from_commit + if easyblock_commit: + easyblocks_from_commit = fetch_easyblocks_from_commit(easyblock_commit) + included_from_commit = set([os.path.basename(eb) for eb in easyblocks_from_commit]) + + if options.include_easyblocks: + check_included_multiple(included_from_commit, "commit %s" % easyblock_commit) + + for easyblock in included_from_commit: + print_msg("easyblock %s included from comit %s" % (easyblock, easyblock_commit), log=log) + + include_easyblocks(options.tmpdir, easyblocks_from_commit) + + if options.list_easyblocks: + msg = list_easyblocks(options.list_easyblocks, options.output_format) + if options.unittest_file: + log.info(msg) + else: + print(msg) + # tmpdir is set by option parser via set_tmpdir function + tmpdir = tempfile.gettempdir() + cleanup_and_exit(tmpdir) + + def set_up_configuration(args=None, logfile=None, testing=False, silent=False, reconfigure=False): """ Set up EasyBuild configuration, by parsing configuration settings & initialising build options. @@ -1538,6 +1619,8 @@ def set_up_configuration(args=None, logfile=None, testing=False, silent=False, r eb_go = parse_options(args=args) options = eb_go.options + check_options(options) + # tmpdir is set by option parser via set_tmpdir function tmpdir = tempfile.gettempdir() @@ -1582,10 +1665,11 @@ def set_up_configuration(args=None, logfile=None, testing=False, silent=False, r # determine robot path # --try-X, --dep-graph, --search use robot path for searching, so enable it with path of installed easyconfigs tweaked_ecs = try_to_generate and build_specs - tweaked_ecs_paths, pr_paths = alt_easyconfig_paths(tmpdir, tweaked_ecs=tweaked_ecs, from_prs=from_prs, - review_pr=review_pr) + tweaked_ecs_paths, extra_ec_paths = alt_easyconfig_paths(tmpdir, tweaked_ecs=tweaked_ecs, from_prs=from_prs, + from_commit=eb_go.options.from_commit, + review_pr=review_pr) auto_robot = try_to_generate or options.check_conflicts or options.dep_graph or search_query - robot_path = det_robot_path(options.robot_paths, tweaked_ecs_paths, pr_paths, auto_robot=auto_robot) + robot_path = det_robot_path(options.robot_paths, tweaked_ecs_paths, extra_ec_paths, auto_robot=auto_robot) log.debug("Full robot path: %s", robot_path) if not robot_path: @@ -1599,7 +1683,7 @@ def set_up_configuration(args=None, logfile=None, testing=False, silent=False, r 'build_specs': build_specs, 'command_line': eb_cmd_line, 'external_modules_metadata': parse_external_modules_metadata(options.external_modules_metadata), - 'pr_paths': pr_paths, + 'extra_ec_paths': extra_ec_paths, 'robot_path': robot_path, 'silent': testing or new_update_opt, 'try_to_generate': try_to_generate, @@ -1625,41 +1709,7 @@ def set_up_configuration(args=None, logfile=None, testing=False, silent=False, r init_build_options(build_options=build_options, cmdline_options=options) # done here instead of in _postprocess_include because github integration requires build_options to be initialized - if eb_go.options.include_easyblocks_from_pr: - try: - easyblock_prs = [int(x) for x in eb_go.options.include_easyblocks_from_pr] - except ValueError: - raise EasyBuildError("Argument to --include-easyblocks-from-pr must be a comma separated list of PR #s.") - - if eb_go.options.include_easyblocks: - # check if you are including the same easyblock twice - included_paths = expand_glob_paths(eb_go.options.include_easyblocks) - included_from_file = set([os.path.basename(eb) for eb in included_paths]) - - for easyblock_pr in easyblock_prs: - easyblocks_from_pr = fetch_easyblocks_from_pr(easyblock_pr) - included_from_pr = set([os.path.basename(eb) for eb in easyblocks_from_pr]) - - if eb_go.options.include_easyblocks: - included_twice = included_from_pr & included_from_file - if included_twice: - warning_msg = "One or more easyblocks included from multiple locations: %s " \ - % ', '.join(included_twice) - warning_msg += "(the one(s) from PR #%s will be used)" % easyblock_pr - print_warning(warning_msg) - - for easyblock in included_from_pr: - print_msg("easyblock %s included from PR #%s" % (easyblock, easyblock_pr), log=log) - - include_easyblocks(eb_go.options.tmpdir, easyblocks_from_pr) - - if eb_go.options.list_easyblocks: - msg = list_easyblocks(eb_go.options.list_easyblocks, eb_go.options.output_format) - if eb_go.options.unittest_file: - log.info(msg) - else: - print(msg) - cleanup_and_exit(tmpdir) + handle_include_easyblocks_from(eb_go.options, log) check_python_version() diff --git a/easybuild/tools/output.py b/easybuild/tools/output.py index c10b169e57..a8f98480f9 100644 --- a/easybuild/tools/output.py +++ b/easybuild/tools/output.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # # -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/package/package_naming_scheme/easybuild_deb_friendly_pns.py b/easybuild/tools/package/package_naming_scheme/easybuild_deb_friendly_pns.py index 9ae9b37419..033687fac1 100644 --- a/easybuild/tools/package/package_naming_scheme/easybuild_deb_friendly_pns.py +++ b/easybuild/tools/package/package_naming_scheme/easybuild_deb_friendly_pns.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- vim: set fileencoding=utf-8 ## -# Copyright 2015-2022 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/package/package_naming_scheme/easybuild_pns.py b/easybuild/tools/package/package_naming_scheme/easybuild_pns.py index a6543a7d53..7a53a86101 100644 --- a/easybuild/tools/package/package_naming_scheme/easybuild_pns.py +++ b/easybuild/tools/package/package_naming_scheme/easybuild_pns.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/package/package_naming_scheme/pns.py b/easybuild/tools/package/package_naming_scheme/pns.py index 081a94b073..8683ae8d37 100644 --- a/easybuild/tools/package/package_naming_scheme/pns.py +++ b/easybuild/tools/package/package_naming_scheme/pns.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/package/utilities.py b/easybuild/tools/package/utilities.py index adaa0814fc..ea18c2b206 100644 --- a/easybuild/tools/package/utilities.py +++ b/easybuild/tools/package/utilities.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -58,7 +58,7 @@ def avail_package_naming_schemes(): They are loaded from the easybuild.package.package_naming_scheme namespace """ import_available_modules('easybuild.tools.package.package_naming_scheme') - class_dict = dict([(x.__name__, x) for x in get_subclasses(PackageNamingScheme)]) + class_dict = {x.__name__: x for x in get_subclasses(PackageNamingScheme)} return class_dict diff --git a/easybuild/tools/parallelbuild.py b/easybuild/tools/parallelbuild.py index 6c94517c69..3ab31e1efc 100644 --- a/easybuild/tools/parallelbuild.py +++ b/easybuild/tools/parallelbuild.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/py2vs3/__init__.py b/easybuild/tools/py2vs3/__init__.py index 4bd0e47191..d0518f2271 100644 --- a/easybuild/tools/py2vs3/__init__.py +++ b/easybuild/tools/py2vs3/__init__.py @@ -1,5 +1,5 @@ # -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/py2vs3/py3.py b/easybuild/tools/py2vs3/py3.py index 21dfc49e10..a01cb64d39 100644 --- a/easybuild/tools/py2vs3/py3.py +++ b/easybuild/tools/py2vs3/py3.py @@ -1,5 +1,5 @@ # -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/repository/filerepo.py b/easybuild/tools/repository/filerepo.py index a35c7054f0..6161b7f37b 100644 --- a/easybuild/tools/repository/filerepo.py +++ b/easybuild/tools/repository/filerepo.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/repository/gitrepo.py b/easybuild/tools/repository/gitrepo.py index 97fc6c33da..feaf8cb2ad 100644 --- a/easybuild/tools/repository/gitrepo.py +++ b/easybuild/tools/repository/gitrepo.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/repository/hgrepo.py b/easybuild/tools/repository/hgrepo.py index 8cdf145b52..83a7890cc3 100644 --- a/easybuild/tools/repository/hgrepo.py +++ b/easybuild/tools/repository/hgrepo.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/repository/repository.py b/easybuild/tools/repository/repository.py index 743a82bc36..1bbde0178a 100644 --- a/easybuild/tools/repository/repository.py +++ b/easybuild/tools/repository/repository.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -145,7 +145,7 @@ def avail_repositories(check_useable=True): """ import_available_modules('easybuild.tools.repository') - class_dict = dict([(x.__name__, x) for x in get_subclasses(Repository) if x.USABLE or not check_useable]) + class_dict = {x.__name__: x for x in get_subclasses(Repository) if x.USABLE or not check_useable} if 'FileRepository' not in class_dict: raise EasyBuildError("avail_repositories: FileRepository missing from list of repositories") diff --git a/easybuild/tools/repository/svnrepo.py b/easybuild/tools/repository/svnrepo.py index 6c955c7fd0..79f593b1ee 100644 --- a/easybuild/tools/repository/svnrepo.py +++ b/easybuild/tools/repository/svnrepo.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/robot.py b/easybuild/tools/robot.py index 68a4c9028b..5189769929 100644 --- a/easybuild/tools/robot.py +++ b/easybuild/tools/robot.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -54,7 +54,7 @@ _log = fancylogger.getLogger('tools.robot', fname=False) -def det_robot_path(robot_paths_option, tweaked_ecs_paths, pr_paths, auto_robot=False): +def det_robot_path(robot_paths_option, tweaked_ecs_paths, extra_ec_paths, auto_robot=False): """Determine robot path.""" robot_path = robot_paths_option[:] _log.info("Using robot path(s): %s", robot_path) @@ -70,9 +70,9 @@ def det_robot_path(robot_paths_option, tweaked_ecs_paths, pr_paths, auto_robot=F _log.info("Prepended list of robot search paths with %s and appended with %s: %s", tweaked_ecs_path, tweaked_ecs_deps_path, robot_path) - if pr_paths is not None: - robot_path.extend(pr_paths) - _log.info("Extended list of robot search paths with %s: %s", pr_paths, robot_path) + if extra_ec_paths is not None: + robot_path.extend(extra_ec_paths) + _log.info("Extended list of robot search paths with %s: %s", extra_ec_paths, robot_path) return robot_path @@ -288,16 +288,18 @@ def dry_run(easyconfigs, modtool, short=False): return '\n'.join(lines) -def missing_deps(easyconfigs, modtool): +def missing_deps(easyconfigs, modtool, terse=False): """ Determine subset of easyconfigs for which no module is installed yet. """ ordered_ecs = resolve_dependencies(easyconfigs, modtool, retain_all_deps=True, raise_error_missing_ecs=False) missing = skip_available(ordered_ecs, modtool) - if missing: + if terse: + lines = [os.path.basename(x['ec'].path) for x in missing] + elif missing: lines = ['', "%d out of %d required modules missing:" % (len(missing), len(ordered_ecs)), ''] - for ec in [x['ec'] for x in missing]: + for ec in (x['ec'] for x in missing): if ec.short_mod_name != ec.full_mod_name: modname = '%s | %s' % (ec.mod_subdir, ec.short_mod_name) else: diff --git a/easybuild/tools/run.py b/easybuild/tools/run.py index d5ba5e27ec..7f06d2ce06 100644 --- a/easybuild/tools/run.py +++ b/easybuild/tools/run.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/systemtools.py b/easybuild/tools/systemtools.py index 657f7ec9f4..73cba6f91a 100644 --- a/easybuild/tools/systemtools.py +++ b/easybuild/tools/systemtools.py @@ -1,5 +1,5 @@ ## -# Copyright 2011-2023 Ghent University +# Copyright 2011-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/testing.py b/easybuild/tools/testing.py index ffd8ce580b..881788337e 100644 --- a/easybuild/tools/testing.py +++ b/easybuild/tools/testing.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -336,6 +336,14 @@ def post_pr_test_report(pr_nrs, repo_type, test_report, msg, init_session_state, comment_lines = ["Test report by @%s" % github_user] + if build_option('include_easyblocks_from_commit'): + if repo_type == GITHUB_EASYCONFIGS_REPO: + easyblocks_commit = build_option('include_easyblocks_from_commit') + url = 'https://github.com/%s/%s/commit/%s' % (pr_target_account, GITHUB_EASYBLOCKS_REPO, easyblocks_commit) + comment_lines.append("Using easyblocks from %s" % url) + else: + raise EasyBuildError("Don't know how to submit test reports to repo %s.", repo_type) + if build_option('include_easyblocks_from_pr'): if repo_type == GITHUB_EASYCONFIGS_REPO: easyblocks_pr_nrs = [int(x) for x in build_option('include_easyblocks_from_pr')] diff --git a/easybuild/tools/toolchain/__init__.py b/easybuild/tools/toolchain/__init__.py index 876d16c44f..cf755a8e40 100644 --- a/easybuild/tools/toolchain/__init__.py +++ b/easybuild/tools/toolchain/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/toolchain/compiler.py b/easybuild/tools/toolchain/compiler.py index 37bdaea211..de69214388 100644 --- a/easybuild/tools/toolchain/compiler.py +++ b/easybuild/tools/toolchain/compiler.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/toolchain/constants.py b/easybuild/tools/toolchain/constants.py index 5655f71961..643e8b4d21 100644 --- a/easybuild/tools/toolchain/constants.py +++ b/easybuild/tools/toolchain/constants.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/toolchain/fft.py b/easybuild/tools/toolchain/fft.py index c0e1dedd1a..b7191d5a26 100644 --- a/easybuild/tools/toolchain/fft.py +++ b/easybuild/tools/toolchain/fft.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/toolchain/linalg.py b/easybuild/tools/toolchain/linalg.py index 907993571c..fd74615c4a 100644 --- a/easybuild/tools/toolchain/linalg.py +++ b/easybuild/tools/toolchain/linalg.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/toolchain/mpi.py b/easybuild/tools/toolchain/mpi.py index 841cbe8ece..1646a27ce0 100644 --- a/easybuild/tools/toolchain/mpi.py +++ b/easybuild/tools/toolchain/mpi.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/toolchain/options.py b/easybuild/tools/toolchain/options.py index 6b2c00c95d..fe94ba44b4 100644 --- a/easybuild/tools/toolchain/options.py +++ b/easybuild/tools/toolchain/options.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/toolchain/toolchain.py b/easybuild/tools/toolchain/toolchain.py index efba3d2e02..c11fb309d3 100644 --- a/easybuild/tools/toolchain/toolchain.py +++ b/easybuild/tools/toolchain/toolchain.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -925,10 +925,11 @@ def is_rpath_wrapper(path): """ Check whether command at specified location already is an RPATH wrapper script rather than the actual command """ - in_rpath_wrappers_dir = os.path.basename(os.path.dirname(os.path.dirname(path))) == RPATH_WRAPPERS_SUBDIR + if os.path.basename(os.path.dirname(os.path.dirname(path))) != RPATH_WRAPPERS_SUBDIR: + return False + # Check if `rpath_args`` is called in the file # need to use binary mode to read the file, since it may be an actual compiler command (which is a binary file) - calls_rpath_args = b'rpath_args.py $CMD' in read_file(path, mode='rb') - return in_rpath_wrappers_dir and calls_rpath_args + return b'rpath_args.py $CMD' in read_file(path, mode='rb') def prepare_rpath_wrappers(self, rpath_filter_dirs=None, rpath_include_dirs=None): """ diff --git a/easybuild/tools/toolchain/toolchainvariables.py b/easybuild/tools/toolchain/toolchainvariables.py index 286b32aea3..dbb5686040 100644 --- a/easybuild/tools/toolchain/toolchainvariables.py +++ b/easybuild/tools/toolchain/toolchainvariables.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/toolchain/utilities.py b/easybuild/tools/toolchain/utilities.py index 56242b8fe4..8047778391 100644 --- a/easybuild/tools/toolchain/utilities.py +++ b/easybuild/tools/toolchain/utilities.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/toolchain/variables.py b/easybuild/tools/toolchain/variables.py index c201f8a6f8..482f989480 100644 --- a/easybuild/tools/toolchain/variables.py +++ b/easybuild/tools/toolchain/variables.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/utilities.py b/easybuild/tools/utilities.py index 1b33dd24f2..fe254ea4d2 100644 --- a/easybuild/tools/utilities.py +++ b/easybuild/tools/utilities.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/variables.py b/easybuild/tools/variables.py index e5fa534c45..cef771f3d8 100644 --- a/easybuild/tools/variables.py +++ b/easybuild/tools/variables.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/tools/version.py b/easybuild/tools/version.py index 2ea349637d..9df4290250 100644 --- a/easybuild/tools/version.py +++ b/easybuild/tools/version.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/eb b/eb index f427c5e7e7..ca401b91c3 100755 --- a/eb +++ b/eb @@ -1,6 +1,6 @@ #!/usr/bin/env bash ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/setup.py b/setup.py index b8f8ae77af..ab38e7ff97 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/__init__.py b/test/__init__.py index 8793b2e4e1..20c9130dcc 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/__init__.py b/test/framework/__init__.py index c6a455e689..fae73ca9e6 100644 --- a/test/framework/__init__.py +++ b/test/framework/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/asyncprocess.py b/test/framework/asyncprocess.py index 56666f3f50..8362e1938e 100644 --- a/test/framework/asyncprocess.py +++ b/test/framework/asyncprocess.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/build_log.py b/test/framework/build_log.py index 581a995c24..2bb705b333 100644 --- a/test/framework/build_log.py +++ b/test/framework/build_log.py @@ -1,5 +1,5 @@ # # -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/config.py b/test/framework/config.py index ce5eb2148e..127fe1f538 100644 --- a/test/framework/config.py +++ b/test/framework/config.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/containers.py b/test/framework/containers.py index bd6dfde7f6..1d9abbf8e4 100644 --- a/test/framework/containers.py +++ b/test/framework/containers.py @@ -1,5 +1,5 @@ # # -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/docs.py b/test/framework/docs.py index ce6fea31fc..3ed97ab192 100644 --- a/test/framework/docs.py +++ b/test/framework/docs.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/easyblock.py b/test/framework/easyblock.py index 61e2f5683d..eed6970e50 100644 --- a/test/framework/easyblock.py +++ b/test/framework/easyblock.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/easyconfig.py b/test/framework/easyconfig.py index 4a1e1df608..7dc088bff3 100644 --- a/test/framework/easyconfig.py +++ b/test/framework/easyconfig.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -737,6 +737,40 @@ def test_tweaking(self): # cleanup os.remove(tweaked_fn) + def test_alt_easyconfig_paths(self): + """Test alt_easyconfig_paths function that collects list of additional paths for easyconfig files.""" + + tweaked_ecs_path, extra_ecs_path = alt_easyconfig_paths(self.test_prefix) + self.assertEqual(tweaked_ecs_path, None) + self.assertEqual(extra_ecs_path, []) + + tweaked_ecs_path, extra_ecs_path = alt_easyconfig_paths(self.test_prefix, tweaked_ecs=True) + self.assertTrue(tweaked_ecs_path) + self.assertTrue(isinstance(tweaked_ecs_path, tuple)) + self.assertEqual(len(tweaked_ecs_path), 2) + self.assertEqual(tweaked_ecs_path[0], os.path.join(self.test_prefix, 'tweaked_easyconfigs')) + self.assertEqual(tweaked_ecs_path[1], os.path.join(self.test_prefix, 'tweaked_dep_easyconfigs')) + self.assertEqual(extra_ecs_path, []) + + tweaked_ecs_path, extra_ecs_path = alt_easyconfig_paths(self.test_prefix, from_prs=[123, 456]) + self.assertEqual(tweaked_ecs_path, None) + self.assertTrue(extra_ecs_path) + self.assertTrue(isinstance(extra_ecs_path, list)) + self.assertEqual(len(extra_ecs_path), 2) + self.assertEqual(extra_ecs_path[0], os.path.join(self.test_prefix, 'files_pr123')) + self.assertEqual(extra_ecs_path[1], os.path.join(self.test_prefix, 'files_pr456')) + + tweaked_ecs_path, extra_ecs_path = alt_easyconfig_paths(self.test_prefix, from_prs=[123, 456], + review_pr=789, from_commit='c0ff33') + self.assertEqual(tweaked_ecs_path, None) + self.assertTrue(extra_ecs_path) + self.assertTrue(isinstance(extra_ecs_path, list)) + self.assertEqual(len(extra_ecs_path), 4) + self.assertEqual(extra_ecs_path[0], os.path.join(self.test_prefix, 'files_pr123')) + self.assertEqual(extra_ecs_path[1], os.path.join(self.test_prefix, 'files_pr456')) + self.assertEqual(extra_ecs_path[2], os.path.join(self.test_prefix, 'files_pr789')) + self.assertEqual(extra_ecs_path[3], os.path.join(self.test_prefix, 'files_commit_c0ff33')) + def test_tweak_multiple_tcs(self): """Test that tweaking variables of ECs from multiple toolchains works""" test_easyconfigs = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', 'test_ecs') @@ -3651,7 +3685,7 @@ def test_resolve_template(self): def test_det_subtoolchain_version(self): """Test det_subtoolchain_version function""" _, all_tc_classes = search_toolchain('') - subtoolchains = dict((tc_class.NAME, getattr(tc_class, 'SUBTOOLCHAIN', None)) for tc_class in all_tc_classes) + subtoolchains = {tc_class.NAME: getattr(tc_class, 'SUBTOOLCHAIN', None) for tc_class in all_tc_classes} optional_toolchains = set(tc_class.NAME for tc_class in all_tc_classes if getattr(tc_class, 'OPTIONAL', False)) current_tc = {'name': 'fosscuda', 'version': '2018a'} diff --git a/test/framework/easyconfigformat.py b/test/framework/easyconfigformat.py index e806a88378..7b84a2c867 100644 --- a/test/framework/easyconfigformat.py +++ b/test/framework/easyconfigformat.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/easyconfigparser.py b/test/framework/easyconfigparser.py index 638137ec56..65d2084d55 100644 --- a/test/framework/easyconfigparser.py +++ b/test/framework/easyconfigparser.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/easyconfigversion.py b/test/framework/easyconfigversion.py index 5ef706a72a..4da54b450a 100644 --- a/test/framework/easyconfigversion.py +++ b/test/framework/easyconfigversion.py @@ -1,5 +1,5 @@ # # -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/easystack.py b/test/framework/easystack.py index 198350a0e7..0c1067a34b 100644 --- a/test/framework/easystack.py +++ b/test/framework/easystack.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/ebconfigobj.py b/test/framework/ebconfigobj.py index d4d81995d8..169fe988a2 100644 --- a/test/framework/ebconfigobj.py +++ b/test/framework/ebconfigobj.py @@ -1,5 +1,5 @@ # # -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/environment.py b/test/framework/environment.py index 9a81e17486..f184c6b9c7 100644 --- a/test/framework/environment.py +++ b/test/framework/environment.py @@ -1,5 +1,5 @@ # # -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -90,8 +90,7 @@ def test_modify_env(self): # prepare test environment first: # keys in new_env should not be set yet, keys in old_env are expected to be set for key in new_env_vars: - if key in os.environ: - del os.environ[key] + os.environ.pop(key, None) for key in old_env_vars: os.environ[key] = old_env_vars[key] diff --git a/test/framework/filetools.py b/test/framework/filetools.py index db85575cdb..16923c55d2 100644 --- a/test/framework/filetools.py +++ b/test/framework/filetools.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -322,7 +322,7 @@ def test_checksums(self): self.assertErrorRegex(EasyBuildError, error_pattern, ft.verify_checksum, fp, checksum) # make sure faulty checksums are reported - broken_checksums = dict([(typ, val[:-3] + 'foo') for (typ, val) in known_checksums.items()]) + broken_checksums = {typ: (val[:-3] + 'foo') for typ, val in known_checksums.items()} for checksum_type, checksum in broken_checksums.items(): self.assertFalse(ft.compute_checksum(fp, checksum_type=checksum_type) == checksum) self.assertFalse(ft.verify_checksum(fp, (checksum_type, checksum))) @@ -1531,8 +1531,7 @@ def test_find_flexlm_license(self): lic_server = '1234@example.license.server' # make test robust against environment in which $LM_LICENSE_FILE is defined - if 'LM_LICENSE_FILE' in os.environ: - del os.environ['LM_LICENSE_FILE'] + os.environ.pop('LM_LICENSE_FILE', None) # default return value self.assertEqual(ft.find_flexlm_license(), ([], None)) @@ -2637,8 +2636,7 @@ def test_find_eb_script(self): """Test find_eb_script function.""" # make sure $EB_SCRIPT_PATH is not set already (used as fallback mechanism in find_eb_script) - if 'EB_SCRIPT_PATH' in os.environ: - del os.environ['EB_SCRIPT_PATH'] + os.environ.pop('EB_SCRIPT_PATH', None) self.assertExists(ft.find_eb_script('rpath_args.py')) self.assertExists(ft.find_eb_script('rpath_wrapper_template.sh.in')) diff --git a/test/framework/format_convert.py b/test/framework/format_convert.py index 1bc3f764bb..e0add188b3 100644 --- a/test/framework/format_convert.py +++ b/test/framework/format_convert.py @@ -1,5 +1,5 @@ # # -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/general.py b/test/framework/general.py index 526fe07467..3837cecc87 100644 --- a/test/framework/general.py +++ b/test/framework/general.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/github.py b/test/framework/github.py index 890ccfa28a..848f67a284 100644 --- a/test/framework/github.py +++ b/test/framework/github.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -52,7 +52,8 @@ from easybuild.tools.filetools import read_file, write_file from easybuild.tools.github import GITHUB_EASYCONFIGS_REPO, GITHUB_EASYBLOCKS_REPO, GITHUB_MERGEABLE_STATE_CLEAN from easybuild.tools.github import VALID_CLOSE_PR_REASONS -from easybuild.tools.github import det_pr_title, is_patch_for, pick_default_branch +from easybuild.tools.github import det_pr_title, fetch_easyconfigs_from_commit, fetch_files_from_commit +from easybuild.tools.github import is_patch_for, pick_default_branch from easybuild.tools.testing import create_test_report, post_pr_test_report, session_state import easybuild.tools.github as gh @@ -541,6 +542,65 @@ def test_github_fetch_files_from_pr_cache(self): res = gh.fetch_easyblocks_from_pr(12345, tmpdir) self.assertEqual(sorted(pr12345_files), sorted(res)) + def test_fetch_files_from_commit(self): + """Test fetch_files_from_commit function.""" + + # easyconfigs commit to add EasyBuild-4.8.2.eb + test_commit = '7c83a553950c233943c7b0189762f8c05cfea852' + + # without specifying any files/repo, default is to use easybuilders/easybuilld-easyconfigs + # and determine which files were changed in the commit + res = fetch_files_from_commit(test_commit) + self.assertEqual(len(res), 1) + ec_path = res[0] + expected_path = 'ecs_commit_7c83a553950c233943c7b0189762f8c05cfea852/e/EasyBuild/EasyBuild-4.8.2.eb' + self.assertTrue(ec_path.endswith(expected_path)) + self.assertTrue(os.path.exists(ec_path)) + self.assertIn("version = '4.8.2'", read_file(ec_path)) + + # also test downloading a specific file from easyblocks repo + # commit that enables use_pip & co in PythonPackage easyblock + test_commit = 'd6f0cd7b586108e40f7cf1f1054bb07e16718caf' + res = fetch_files_from_commit(test_commit, files=['pythonpackage.py'], + github_account='easybuilders', github_repo='easybuild-easyblocks') + self.assertEqual(len(res), 1) + self.assertIn("'use_pip': [True,", read_file(res[0])) + + # test downloading with short commit, download_repo currently enforces using long commit + error_pattern = r"Specified commit SHA 7c83a55 for downloading easybuilders/easybuild-easyconfigs " + error_pattern += r"is not valid, must be full SHA-1 \(40 chars\)" + self.assertErrorRegex(EasyBuildError, error_pattern, fetch_files_from_commit, '7c83a55') + + # test downloading of non-existing commit + error_pattern = r"Failed to download diff for commit c0ff33c0ff33 of easybuilders/easybuild-easyconfigs" + self.assertErrorRegex(EasyBuildError, error_pattern, fetch_files_from_commit, 'c0ff33c0ff33') + + def test_fetch_easyconfigs_from_commit(self): + """Test fetch_easyconfigs_from_commit function.""" + + # commit in which easyconfigs for PyTables 3.9.2 + dependencies were added + test_commit = '6515b44cd84a20fe7876cb4bdaf3c0080e688566' + + # without specifying any files/repo, default is to determine which files were changed in the commit + res = fetch_easyconfigs_from_commit(test_commit) + self.assertEqual(len(res), 5) + expected_ec_filenames = ['Blosc-1.21.5-GCCcore-13.2.0.eb', 'Blosc2-2.13.2-GCCcore-13.2.0.eb', + 'PyTables-3.9.2-foss-2023b.eb', 'PyTables-3.9.2_fix-find-blosc2-dep.patch', + 'py-cpuinfo-9.0.0-GCCcore-13.2.0.eb'] + self.assertEqual(sorted([os.path.basename(f) for f in res]), expected_ec_filenames) + for ec_path in res: + self.assertTrue(os.path.exists(ec_path)) + if ec_path.endswith('.eb'): + self.assertIn("version =", read_file(ec_path)) + else: + self.assertTrue(ec_path.endswith('.patch')) + + # merge commit for release of EasyBuild v4.9.0 + test_commit = 'bdcc586189fcb3e5a340cddebb50d0e188c63cdc' + res = fetch_easyconfigs_from_commit(test_commit, files=['RELEASE_NOTES'], path=self.test_prefix) + self.assertEqual(len(res), 1) + self.assertIn("v4.9.0 (30 December 2023)", read_file(res[0])) + def test_github_fetch_latest_commit_sha(self): """Test fetch_latest_commit_sha function.""" if self.skip_github_tests: @@ -597,6 +657,34 @@ def test_github_download_repo(self): self.assertExists(os.path.join(repodir, 'easybuild', 'easyblocks', '__init__.py')) self.mock_stdout(False) + def test_github_download_repo_commit(self): + """Test downloading repo at specific commit (which does not require any GitHub token)""" + + # commit bdcc586189fcb3e5a340cddebb50d0e188c63cdc corresponds to easybuild-easyconfigs release v4.9.0 + test_commit = 'bdcc586189fcb3e5a340cddebb50d0e188c63cdc' + gh.download_repo(path=self.test_prefix, commit=test_commit) + repo_path = os.path.join(self.test_prefix, 'easybuilders', 'easybuild-easyconfigs-' + test_commit) + self.assertTrue(os.path.exists(repo_path)) + + setup_py_txt = read_file(os.path.join(repo_path, 'setup.py')) + self.assertTrue("VERSION = '4.9.0'" in setup_py_txt) + + # also check downloading non-default forked repo + test_commit = '434151c3dbf88b2382e8ead8655b4b2c01b92617' + gh.download_repo(path=self.test_prefix, account='boegel', repo='easybuild-framework', commit=test_commit) + repo_path = os.path.join(self.test_prefix, 'boegel', 'easybuild-framework-' + test_commit) + self.assertTrue(os.path.exists(repo_path)) + + release_notes_txt = read_file(os.path.join(repo_path, 'RELEASE_NOTES')) + self.assertTrue("v4.9.0 (30 December 2023)" in release_notes_txt) + + # short commit doesn't work, must be full commit ID + self.assertErrorRegex(EasyBuildError, "Specified commit SHA bdcc586 .* is not valid", gh.download_repo, + path=self.test_prefix, commit='bdcc586') + + self.assertErrorRegex(EasyBuildError, "Failed to download tarball .* commit", gh.download_repo, + path=self.test_prefix, commit='0000000000000000000000000000000000000000') + def test_install_github_token(self): """Test for install_github_token function.""" if self.skip_github_tests: diff --git a/test/framework/hooks.py b/test/framework/hooks.py index c8e5d34583..0cc478f53e 100644 --- a/test/framework/hooks.py +++ b/test/framework/hooks.py @@ -1,5 +1,5 @@ # # -# Copyright 2017-2023 Ghent University +# Copyright 2017-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/include.py b/test/framework/include.py index b346f911ae..09a5925a2f 100644 --- a/test/framework/include.py +++ b/test/framework/include.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/lib.py b/test/framework/lib.py index a6459b28c3..b3deff6070 100644 --- a/test/framework/lib.py +++ b/test/framework/lib.py @@ -1,5 +1,5 @@ # # -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/license.py b/test/framework/license.py index 8b231a8346..768c5ed6b4 100644 --- a/test/framework/license.py +++ b/test/framework/license.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/module_generator.py b/test/framework/module_generator.py index d2fbb6f642..075cc3adbd 100644 --- a/test/framework/module_generator.py +++ b/test/framework/module_generator.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -900,8 +900,7 @@ def test_getenv_cmd(self): if self.MODULE_GENERATOR_CLASS == ModuleGeneratorTcl: # can't have $LMOD_QUIET set when testing with Tcl syntax, # otherwise we won't get the output produced by the test module file... - if 'LMOD_QUIET' in os.environ: - del os.environ['LMOD_QUIET'] + os.environ.pop('LMOD_QUIET', None) self.assertEqual('$::env(HOSTNAME)', self.modgen.getenv_cmd('HOSTNAME')) self.assertEqual('$::env(HOME)', self.modgen.getenv_cmd('HOME')) diff --git a/test/framework/modules.py b/test/framework/modules.py index dd6d66e70d..95f465ee6f 100644 --- a/test/framework/modules.py +++ b/test/framework/modules.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -99,8 +99,7 @@ def test_run_module(self): testdir = os.path.dirname(os.path.abspath(__file__)) for key in ['EBROOTGCC', 'EBROOTOPENMPI', 'EBROOTOPENBLAS']: - if key in os.environ: - del os.environ[key] + os.environ.pop(key, None) # arguments can be passed in two ways: multiple arguments, or just 1 list argument self.modtool.run_module('load', 'GCC/6.4.0-2.28') @@ -469,8 +468,7 @@ def test_load(self): self.assertEqual(self.modtool.loaded_modules()[-1], 'GCC/6.4.0-2.28') # set things up for checking that GCC does *not* get reloaded when requested - if 'EBROOTGCC' in os.environ: - del os.environ['EBROOTGCC'] + os.environ.pop('EBROOTGCC', None) self.modtool.load(['OpenMPI/2.1.2-GCC-6.4.0-2.28']) if isinstance(self.modtool, Lmod): # order of loaded modules only changes with Lmod @@ -1047,8 +1045,7 @@ def test_modules_tool_stateless(self): init_config() # make sure $LMOD_DEFAULT_MODULEPATH, since Lmod picks it up and tweaks $MODULEPATH to match it - if 'LMOD_DEFAULT_MODULEPATH' in os.environ: - del os.environ['LMOD_DEFAULT_MODULEPATH'] + os.environ.pop('LMOD_DEFAULT_MODULEPATH', None) self.reset_modulepath([os.path.join(self.test_prefix, 'Core')]) @@ -1070,8 +1067,7 @@ def test_modules_tool_stateless(self): self.modtool.load(['OpenMPI/2.1.2']) self.modtool.purge() - if 'LMOD_DEFAULT_MODULEPATH' in os.environ: - del os.environ['LMOD_DEFAULT_MODULEPATH'] + os.environ.pop('LMOD_DEFAULT_MODULEPATH', None) # reset $MODULEPATH, obtain new ModulesTool instance, # which should not remember anything w.r.t. previous $MODULEPATH value diff --git a/test/framework/modulestool.py b/test/framework/modulestool.py index 3c3eae74f5..7b1202c2eb 100644 --- a/test/framework/modulestool.py +++ b/test/framework/modulestool.py @@ -1,5 +1,5 @@ # # -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -232,8 +232,7 @@ def tearDown(self): if self.orig_module is not None: os.environ['module'] = self.orig_module else: - if 'module' in os.environ: - del os.environ['module'] + os.environ.pop('module', None) def suite(): diff --git a/test/framework/options.py b/test/framework/options.py index 82fc675eb4..c401105116 100644 --- a/test/framework/options.py +++ b/test/framework/options.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -1453,6 +1453,70 @@ def test_github_copy_ec_from_pr(self): self.assertIn("name = 'ExifTool'", read_file(test_ec)) remove_file(test_ec) + def test_copy_ec_from_commit(self): + """Test combination of --copy-ec with --from-commit.""" + # note: --from-commit does not involve using GitHub API, so no GitHub token required + + # using easyconfigs commit to add EasyBuild-4.8.2.eb + test_commit = '7c83a553950c233943c7b0189762f8c05cfea852' + + test_dir = os.path.join(self.test_prefix, 'from_commit') + mkdir(test_dir, parents=True) + args = ['--copy-ec', '--from-commit=%s' % test_commit, test_dir] + try: + stdout = self.mocked_main(args) + except URLError as err: + print("Ignoring URLError '%s' in test_copy_ec_from_commit" % err) + + pattern = "_%s/e/EasyBuild/EasyBuild-4.8.2.eb copied to " % test_commit + self.assertIn(pattern, stdout) + copied_ecs = os.listdir(test_dir) + self.assertEqual(copied_ecs, ['EasyBuild-4.8.2.eb']) + + # cleanup + remove_dir(test_dir) + mkdir(test_dir) + + # test again, using extra argument (name of file to copy), without specifying target directory + # (should copy to current directory) + cwd = change_dir(test_dir) + args = ['--copy-ec', '--from-commit=%s' % test_commit, "EasyBuild-4.8.2.eb"] + try: + stdout = self.mocked_main(args) + except URLError as err: + print("Ignoring URLError '%s' in test_copy_ec_from_commit" % err) + + self.assertIn(pattern, stdout) + copied_ecs = os.listdir(test_dir) + self.assertEqual(copied_ecs, ['EasyBuild-4.8.2.eb']) + + # cleanup + change_dir(cwd) + remove_dir(test_dir) + mkdir(test_dir) + + # test with commit that touches a bunch of easyconfigs + test_commit = '49c887397b1a948e1909fc24bc905fdc1ad38388' + expected_ecs = [ + 'gompi-2023b.eb', + 'gfbf-2023b.eb', + 'ScaLAPACK-2.2.0-gompi-2023b-fb.eb', + 'foss-2023b.eb', + 'HPL-2.3-foss-2023b.eb', + 'FFTW.MPI-3.3.10-gompi-2023b.eb', + 'SciPy-bundle-2023.11-gfbf-2023b.eb', + 'OSU-Micro-Benchmarks-7.2-gompi-2023b.eb', + ] + args = ['--copy-ec', '--from-commit=%s' % test_commit, test_dir] + try: + stdout = self.mocked_main(args) + except URLError as err: + print("Ignoring URLError '%s' in test_copy_ec_from_commit" % err) + + copied_ecs = os.listdir(test_dir) + for ec in expected_ecs: + self.assertIn(ec, copied_ecs) + def test_dry_run(self): """Test dry run (long format).""" fd, dummylogfn = tempfile.mkstemp(prefix='easybuild-dummy', suffix='.log') @@ -1504,14 +1568,26 @@ def test_missing(self): ]) for opt in ['-M', '--missing-modules']: - self.mock_stderr(True) - self.mock_stdout(True) - self.eb_main(args + [opt], testing=False, raise_error=True) - stderr, stdout = self.get_stderr(), self.get_stdout() - self.mock_stderr(False) - self.mock_stdout(False) + with self.mocked_stdout_stderr(): + self.eb_main(args + [opt], testing=False, raise_error=True) + stderr, stdout = self.get_stderr(), self.get_stdout() self.assertFalse(stderr) self.assertIn(expected, stdout) + # --terse + with self.mocked_stdout_stderr(): + self.eb_main(args + ['-M', '--terse'], testing=False, raise_error=True) + stderr, stdout = self.get_stderr(), self.get_stdout() + self.assertFalse(stderr) + if mns == 'HierarchicalMNS': + expected = '\n'.join([ + "GCC-4.6.3.eb", + "intel-2018a.eb", + "toy-0.0-deps.eb", + "gzip-1.4-GCC-4.6.3.eb", + ]) + else: + expected = 'gzip-1.4-GCC-4.6.3.eb' + self.assertEqual(stdout, expected + '\n') def test_dry_run_short(self): """Test dry run (short format).""" @@ -2055,6 +2131,92 @@ def test_github_from_pr_x(self): except URLError as err: print("Ignoring URLError '%s' in test_from_pr_x" % err) + def test_from_commit(self): + """Test for --from-commit.""" + # note: --from-commit does not involve using GitHub API, so no GitHub token required + + # easyconfigs commit to add EasyBuild-4.8.2.eb + test_commit = '7c83a553950c233943c7b0189762f8c05cfea852' + + fd, dummylogfn = tempfile.mkstemp(prefix='easybuild-dummy', suffix='.log') + os.close(fd) + + tmpdir = tempfile.mkdtemp() + args = [ + '--from-commit=%s' % test_commit, + '--dry-run', + '--tmpdir=%s' % tmpdir, + ] + try: + outtxt = self.eb_main(args, logfile=dummylogfn, raise_error=True) + modules = [ + (tmpdir, 'EasyBuild/4.8.2'), + ] + for path_prefix, module in modules: + ec_fn = "%s.eb" % '-'.join(module.split('/')) + path = '.*%s' % os.path.dirname(path_prefix) + regex = re.compile(r"^ \* \[.\] %s.*%s \(module: %s\)$" % (path, ec_fn, module), re.M) + self.assertTrue(regex.search(outtxt), "Found pattern %s in %s" % (regex.pattern, outtxt)) + + # make sure that *only* these modules are listed, no others + regex = re.compile(r"^ \* \[.\] .*/(?P.*) \(module: (?P.*)\)$", re.M) + self.assertTrue(sorted(regex.findall(outtxt)), sorted(modules)) + + pr_tmpdir = os.path.join(tmpdir, r'eb-\S{6,8}', 'files_commit_%s' % test_commit) + regex = re.compile(r"Extended list of robot search paths with \['%s'\]:" % pr_tmpdir, re.M) + self.assertTrue(regex.search(outtxt), "Found pattern %s in %s" % (regex.pattern, outtxt)) + except URLError as err: + print("Ignoring URLError '%s' in test_from_commit" % err) + shutil.rmtree(tmpdir) + + # must be run after test for --list-easyblocks, hence the '_xxx_' + # cleaning up the imported easyblocks is quite difficult... + def test_xxx_include_easyblocks_from_commit(self): + """Test for --include-easyblocks-from-commit.""" + # note: --include-easyblocks-from-commit does not involve using GitHub API, so no GitHub token required + + orig_local_sys_path = sys.path[:] + # easyblocks commit only touching Binary easyblock + test_commit = '94d28c556947bd96d0978df775b15a50a4600c6f' + + fd, dummylogfn = tempfile.mkstemp(prefix='easybuild-dummy', suffix='.log') + os.close(fd) + + tmpdir = tempfile.mkdtemp() + args = [ + '--include-easyblocks-from-commit=%s' % test_commit, + '--dry-run', + '--tmpdir=%s' % tmpdir, + 'toy-0.0.eb', # test easyconfig + ] + try: + self.mock_stdout(True) + self.mock_stderr(True) + outtxt = self.eb_main(args, logfile=dummylogfn, raise_error=True) + stdout = self.get_stdout() + stderr = self.get_stderr() + self.mock_stdout(False) + self.mock_stderr(False) + + # 'undo' import of foo easyblock + del sys.modules['easybuild.easyblocks.generic.binary'] + sys.path[:] = orig_local_sys_path + import easybuild.easyblocks + reload(easybuild.easyblocks) + import easybuild.easyblocks.generic + reload(easybuild.easyblocks.generic) + + pattern = "== easyblock binary.py included from comit %s" % test_commit + self.assertEqual(stderr, '') + self.assertIn(pattern, stdout) + + regex = re.compile(r"^ \* \[.\] .*/toy-0.0.eb \(module: toy/0.0\)$", re.M) + self.assertTrue(regex.search(outtxt), "Found pattern %s in %s" % (regex.pattern, outtxt)) + + except URLError as err: + print("Ignoring URLError '%s' in test_include_easyblocks_from_commit" % err) + shutil.rmtree(tmpdir) + def test_no_such_software(self): """Test using no arguments.""" @@ -3247,8 +3409,7 @@ def test_show_default_configfiles(self): home = os.environ['HOME'] for envvar in ['XDG_CONFIG_DIRS', 'XDG_CONFIG_HOME']: - if envvar in os.environ: - del os.environ[envvar] + os.environ.pop(envvar, None) reload(easybuild.tools.options) args = [ @@ -5081,8 +5242,7 @@ def test_show_config_cfg_levels(self): """Test --show-config in relation to how configuring across multiple configuration levels interacts with it.""" # make sure default module syntax is used - if 'EASYBUILD_MODULE_SYNTAX' in os.environ: - del os.environ['EASYBUILD_MODULE_SYNTAX'] + os.environ.pop('EASYBUILD_MODULE_SYNTAX', None) # configuring --modules-tool and --module-syntax on different levels should NOT cause problems # cfr. bug report https://github.com/easybuilders/easybuild-framework/issues/2564 @@ -5108,8 +5268,7 @@ def test_modules_tool_vs_syntax_check(self): """Verify that check for modules tool vs syntax works.""" # make sure default module syntax is used - if 'EASYBUILD_MODULE_SYNTAX' in os.environ: - del os.environ['EASYBUILD_MODULE_SYNTAX'] + os.environ.pop('EASYBUILD_MODULE_SYNTAX', None) # using EnvironmentModulesC modules tool with default module syntax (Lua) is a problem os.environ['EASYBUILD_MODULES_TOOL'] = 'EnvironmentModulesC' @@ -6848,8 +7007,7 @@ def test_easystack_opts(self): mod_ext = '.lua' if get_module_syntax() == 'Lua' else '' # make sure that $EBROOTLIBTOY is not defined - if 'EBROOTLIBTOY' in os.environ: - del os.environ['EBROOTLIBTOY'] + os.environ.pop('EBROOTLIBTOY', None) # libtoy module should be installed, module file should at least set EBROOTLIBTOY mod_dir = os.path.join(self.test_installpath, 'modules', 'all') diff --git a/test/framework/output.py b/test/framework/output.py index d1673a55d1..4429fe29ee 100644 --- a/test/framework/output.py +++ b/test/framework/output.py @@ -1,5 +1,5 @@ # # -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/package.py b/test/framework/package.py index 7298d6ecc9..72b14629bc 100644 --- a/test/framework/package.py +++ b/test/framework/package.py @@ -1,5 +1,5 @@ # # -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/parallelbuild.py b/test/framework/parallelbuild.py index 87f62fbab8..ce3f8331d4 100644 --- a/test/framework/parallelbuild.py +++ b/test/framework/parallelbuild.py @@ -1,5 +1,5 @@ # # -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/repository.py b/test/framework/repository.py index acc2749c55..808f9fd43c 100644 --- a/test/framework/repository.py +++ b/test/framework/repository.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/robot.py b/test/framework/robot.py index f52e9b2c5c..62350bfae4 100644 --- a/test/framework/robot.py +++ b/test/framework/robot.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -128,8 +128,7 @@ def tearDown(self): config.modules_tool = ORIG_MODULES_TOOL ecec.modules_tool = ORIG_ECEC_MODULES_TOOL if ORIG_MODULE_FUNCTION is None: - if 'module' in os.environ: - del os.environ['module'] + os.environ.pop('module', None) else: os.environ['module'] = ORIG_MODULE_FUNCTION self.modtool = self.orig_modtool @@ -713,6 +712,47 @@ def test_search_paths(self): regex = re.compile(r"^ \* %s$" % os.path.join(self.test_prefix, test_ec), re.M) self.assertTrue(regex.search(outtxt), "Found pattern %s in %s" % (regex.pattern, outtxt)) + def test_github_det_easyconfig_paths_from_commit(self): + """Test det_easyconfig_paths function in combination with --from-commit.""" + # note: --from-commit does not involve using GitHub API, so no GitHub token required + + test_ecs_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', 'test_ecs') + + commit = '589282cf52609067616fc2a522f8e4b81f809cb7' + args = [ + os.path.join(test_ecs_path, 't', 'toy', 'toy-0.0.eb'), # absolute path + 'toy-0.0-iter.eb', # relative path, available via robot search path + # commit in which ReFrame-4.3.2.eb was added, + # see https://github.com/easybuilders/easybuild-easyconfigs/pull/18763/commits + '--from-commit', commit, + 'ReFrame-4.3.2.eb', # easyconfig included in commit, should be resolved via robot search path + '--dry-run', + '--robot', + '--robot=%s' % test_ecs_path, + '--unittest-file=%s' % self.logfile, + '--tmpdir=%s' % self.test_prefix, + ] + + self.mock_stderr(True) + outtxt = self.eb_main(args, raise_error=True) + stderr = self.get_stderr() + self.mock_stderr(False) + + self.assertFalse(stderr) + + # full path doesn't matter (helps to avoid failing tests due to resolved symlinks) + test_ecs_path = os.path.join('.*', 'test', 'framework', 'easyconfigs', 'test_ecs') + + modules = [ + (test_ecs_path, 'toy/0.0'), + (test_ecs_path, 'toy/0.0-iter'), + (os.path.join(self.test_prefix, '.*', 'files_commit_%s' % commit), 'ReFrame/4.3.2'), + ] + for path_prefix, module in modules: + ec_fn = "%s.eb" % '-'.join(module.split('/')) + regex = re.compile(r"^ \* \[.\] %s.*%s \(module: %s\)$" % (path_prefix, ec_fn, module), re.M) + self.assertTrue(regex.search(outtxt), "Found pattern %s in %s" % (regex.pattern, outtxt)) + def test_github_det_easyconfig_paths_from_pr(self): """Test det_easyconfig_paths function, with --from-pr enabled as well.""" if self.github_token is None: @@ -1084,8 +1124,8 @@ def test_tweak_robotpath(self): test_easyconfigs = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', 'test_ecs') # Create directories to store the tweaked easyconfigs - tweaked_ecs_paths, pr_paths = alt_easyconfig_paths(self.test_prefix, tweaked_ecs=True) - robot_path = det_robot_path([test_easyconfigs], tweaked_ecs_paths, pr_paths, auto_robot=True) + tweaked_ecs_paths, extra_ec_paths = alt_easyconfig_paths(self.test_prefix, tweaked_ecs=True) + robot_path = det_robot_path([test_easyconfigs], tweaked_ecs_paths, extra_ec_paths, auto_robot=True) init_config(build_options={ 'valid_module_classes': module_classes(), diff --git a/test/framework/run.py b/test/framework/run.py index 142ae61b44..aec941c552 100644 --- a/test/framework/run.py +++ b/test/framework/run.py @@ -1,6 +1,6 @@ # # # -*- coding: utf-8 -*- -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/e/easybuildmeta.py b/test/framework/sandbox/easybuild/easyblocks/e/easybuildmeta.py index e27c0c66d0..7d2ef2d6da 100644 --- a/test/framework/sandbox/easybuild/easyblocks/e/easybuildmeta.py +++ b/test/framework/sandbox/easybuild/easyblocks/e/easybuildmeta.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2020 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/f/fftw.py b/test/framework/sandbox/easybuild/easyblocks/f/fftw.py index 194cead197..0871ce62e1 100644 --- a/test/framework/sandbox/easybuild/easyblocks/f/fftw.py +++ b/test/framework/sandbox/easybuild/easyblocks/f/fftw.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/f/foo.py b/test/framework/sandbox/easybuild/easyblocks/f/foo.py index 07e21608fa..b5a91d9503 100644 --- a/test/framework/sandbox/easybuild/easyblocks/f/foo.py +++ b/test/framework/sandbox/easybuild/easyblocks/f/foo.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/f/foofoo.py b/test/framework/sandbox/easybuild/easyblocks/f/foofoo.py index 3d64b1cf97..6415d6e6e1 100644 --- a/test/framework/sandbox/easybuild/easyblocks/f/foofoo.py +++ b/test/framework/sandbox/easybuild/easyblocks/f/foofoo.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/g/gcc.py b/test/framework/sandbox/easybuild/easyblocks/g/gcc.py index a85b2482fa..5ee5aae1c6 100644 --- a/test/framework/sandbox/easybuild/easyblocks/g/gcc.py +++ b/test/framework/sandbox/easybuild/easyblocks/g/gcc.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/generic/bar.py b/test/framework/sandbox/easybuild/easyblocks/generic/bar.py index d2faf66053..8ba475f700 100644 --- a/test/framework/sandbox/easybuild/easyblocks/generic/bar.py +++ b/test/framework/sandbox/easybuild/easyblocks/generic/bar.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/generic/childcustomdummyextension.py b/test/framework/sandbox/easybuild/easyblocks/generic/childcustomdummyextension.py index 4973f681e3..a7fa78d986 100644 --- a/test/framework/sandbox/easybuild/easyblocks/generic/childcustomdummyextension.py +++ b/test/framework/sandbox/easybuild/easyblocks/generic/childcustomdummyextension.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/generic/configuremake.py b/test/framework/sandbox/easybuild/easyblocks/generic/configuremake.py index 4ad690fe5c..b82668434c 100644 --- a/test/framework/sandbox/easybuild/easyblocks/generic/configuremake.py +++ b/test/framework/sandbox/easybuild/easyblocks/generic/configuremake.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/generic/deprecateddummyextension.py b/test/framework/sandbox/easybuild/easyblocks/generic/deprecateddummyextension.py index 46f10d49ae..eca1ee1435 100644 --- a/test/framework/sandbox/easybuild/easyblocks/generic/deprecateddummyextension.py +++ b/test/framework/sandbox/easybuild/easyblocks/generic/deprecateddummyextension.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/generic/dummyextension.py b/test/framework/sandbox/easybuild/easyblocks/generic/dummyextension.py index d754117b39..3466ce28f2 100644 --- a/test/framework/sandbox/easybuild/easyblocks/generic/dummyextension.py +++ b/test/framework/sandbox/easybuild/easyblocks/generic/dummyextension.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/generic/makecp.py b/test/framework/sandbox/easybuild/easyblocks/generic/makecp.py index 6b258c87d6..dd89704638 100644 --- a/test/framework/sandbox/easybuild/easyblocks/generic/makecp.py +++ b/test/framework/sandbox/easybuild/easyblocks/generic/makecp.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2020 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/generic/modulerc.py b/test/framework/sandbox/easybuild/easyblocks/generic/modulerc.py index 33ab7db67f..72252a46f4 100644 --- a/test/framework/sandbox/easybuild/easyblocks/generic/modulerc.py +++ b/test/framework/sandbox/easybuild/easyblocks/generic/modulerc.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/generic/pythonbundle.py b/test/framework/sandbox/easybuild/easyblocks/generic/pythonbundle.py index 0321602f3f..9c01951adf 100644 --- a/test/framework/sandbox/easybuild/easyblocks/generic/pythonbundle.py +++ b/test/framework/sandbox/easybuild/easyblocks/generic/pythonbundle.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2020 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/generic/toolchain.py b/test/framework/sandbox/easybuild/easyblocks/generic/toolchain.py index fb81a51c96..5151221a13 100644 --- a/test/framework/sandbox/easybuild/easyblocks/generic/toolchain.py +++ b/test/framework/sandbox/easybuild/easyblocks/generic/toolchain.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/generic/toy_extension.py b/test/framework/sandbox/easybuild/easyblocks/generic/toy_extension.py index d6009051f9..37818b4954 100644 --- a/test/framework/sandbox/easybuild/easyblocks/generic/toy_extension.py +++ b/test/framework/sandbox/easybuild/easyblocks/generic/toy_extension.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/h/hpl.py b/test/framework/sandbox/easybuild/easyblocks/h/hpl.py index 89fba75c30..db929d4d31 100644 --- a/test/framework/sandbox/easybuild/easyblocks/h/hpl.py +++ b/test/framework/sandbox/easybuild/easyblocks/h/hpl.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/l/libtoy.py b/test/framework/sandbox/easybuild/easyblocks/l/libtoy.py index 2c0ba5a9e5..20cc2f4b4a 100644 --- a/test/framework/sandbox/easybuild/easyblocks/l/libtoy.py +++ b/test/framework/sandbox/easybuild/easyblocks/l/libtoy.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/o/openblas.py b/test/framework/sandbox/easybuild/easyblocks/o/openblas.py index bfb118cefa..e5dc093347 100644 --- a/test/framework/sandbox/easybuild/easyblocks/o/openblas.py +++ b/test/framework/sandbox/easybuild/easyblocks/o/openblas.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/o/openmpi.py b/test/framework/sandbox/easybuild/easyblocks/o/openmpi.py index 630d5413a7..b110b4f921 100644 --- a/test/framework/sandbox/easybuild/easyblocks/o/openmpi.py +++ b/test/framework/sandbox/easybuild/easyblocks/o/openmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/s/scalapack.py b/test/framework/sandbox/easybuild/easyblocks/s/scalapack.py index d404f81648..3ded1247f4 100644 --- a/test/framework/sandbox/easybuild/easyblocks/s/scalapack.py +++ b/test/framework/sandbox/easybuild/easyblocks/s/scalapack.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/t/toy.py b/test/framework/sandbox/easybuild/easyblocks/t/toy.py index 285302a3ec..5727dcd0e0 100644 --- a/test/framework/sandbox/easybuild/easyblocks/t/toy.py +++ b/test/framework/sandbox/easybuild/easyblocks/t/toy.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/t/toy_buggy.py b/test/framework/sandbox/easybuild/easyblocks/t/toy_buggy.py index 43d7433265..7395c99247 100644 --- a/test/framework/sandbox/easybuild/easyblocks/t/toy_buggy.py +++ b/test/framework/sandbox/easybuild/easyblocks/t/toy_buggy.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/t/toy_eula.py b/test/framework/sandbox/easybuild/easyblocks/t/toy_eula.py index 24f8321a09..8673dd8f60 100644 --- a/test/framework/sandbox/easybuild/easyblocks/t/toy_eula.py +++ b/test/framework/sandbox/easybuild/easyblocks/t/toy_eula.py @@ -1,5 +1,5 @@ ## -# Copyright 2020-2023 Ghent University +# Copyright 2020-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/easyblocks/t/toytoy.py b/test/framework/sandbox/easybuild/easyblocks/t/toytoy.py index a1fc62c69b..a3ef746d53 100644 --- a/test/framework/sandbox/easybuild/easyblocks/t/toytoy.py +++ b/test/framework/sandbox/easybuild/easyblocks/t/toytoy.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/tools/__init__.py b/test/framework/sandbox/easybuild/tools/__init__.py index 1fbb2401b7..389c5ff367 100644 --- a/test/framework/sandbox/easybuild/tools/__init__.py +++ b/test/framework/sandbox/easybuild/tools/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/tools/module_naming_scheme/__init__.py b/test/framework/sandbox/easybuild/tools/module_naming_scheme/__init__.py index 3a9383c79f..a519340298 100644 --- a/test/framework/sandbox/easybuild/tools/module_naming_scheme/__init__.py +++ b/test/framework/sandbox/easybuild/tools/module_naming_scheme/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2011-2023 Ghent University +# Copyright 2011-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/tools/module_naming_scheme/broken_module_naming_scheme.py b/test/framework/sandbox/easybuild/tools/module_naming_scheme/broken_module_naming_scheme.py index 4d33d3d1e7..9113d89045 100644 --- a/test/framework/sandbox/easybuild/tools/module_naming_scheme/broken_module_naming_scheme.py +++ b/test/framework/sandbox/easybuild/tools/module_naming_scheme/broken_module_naming_scheme.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/tools/module_naming_scheme/test_module_naming_scheme.py b/test/framework/sandbox/easybuild/tools/module_naming_scheme/test_module_naming_scheme.py index 5d8dec26c8..424fb55d43 100644 --- a/test/framework/sandbox/easybuild/tools/module_naming_scheme/test_module_naming_scheme.py +++ b/test/framework/sandbox/easybuild/tools/module_naming_scheme/test_module_naming_scheme.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/sandbox/easybuild/tools/module_naming_scheme/test_module_naming_scheme_more.py b/test/framework/sandbox/easybuild/tools/module_naming_scheme/test_module_naming_scheme_more.py index 3cbb5cb60d..a0e0429bfe 100644 --- a/test/framework/sandbox/easybuild/tools/module_naming_scheme/test_module_naming_scheme_more.py +++ b/test/framework/sandbox/easybuild/tools/module_naming_scheme/test_module_naming_scheme_more.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/style.py b/test/framework/style.py index 298b165c24..bfdf4e026a 100644 --- a/test/framework/style.py +++ b/test/framework/style.py @@ -1,5 +1,5 @@ ## -# Copyright 2016-2023 Ghent University +# Copyright 2016-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/suite.py b/test/framework/suite.py index e109848340..97522ffacf 100755 --- a/test/framework/suite.py +++ b/test/framework/suite.py @@ -1,6 +1,6 @@ #!/usr/bin/python # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/systemtools.py b/test/framework/systemtools.py index 68a81c814f..fd40d2c60a 100644 --- a/test/framework/systemtools.py +++ b/test/framework/systemtools.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/toolchain.py b/test/framework/toolchain.py index 918b344dcf..eb6bf1d4cd 100644 --- a/test/framework/toolchain.py +++ b/test/framework/toolchain.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -152,8 +152,7 @@ def test_toolchain_prepare_sysroot(self): # clean environment self.unset_compiler_env_vars() - if 'PKG_CONFIG_PATH' in os.environ: - del os.environ['PKG_CONFIG_PATH'] + os.environ.pop('PKG_CONFIG_PATH', None) self.assertEqual(os.getenv('PKG_CONFIG_PATH'), None) @@ -203,8 +202,7 @@ def unset_compiler_env_vars(self): env_vars.extend(['OMPI_%s' % x for x in comp_env_vars]) for key in env_vars: - if key in os.environ: - del os.environ[key] + os.environ.pop(key, None) def test_toolchain_compiler_env_vars(self): """Test whether environment variables for compilers are defined by toolchain mechanism.""" @@ -322,8 +320,7 @@ def test_toolchain_compiler_env_vars(self): init_config(build_options={'minimal_build_env': 'CC:gcc,CXX:g++,CFLAGS:-O2,CXXFLAGS:-O3 -g,FC:gfortan'}) for key in ['CFLAGS', 'CXXFLAGS', 'FC']: - if key in os.environ: - del os.environ[key] + os.environ.pop(key, None) self.mock_stderr(True) self.mock_stdout(True) @@ -2352,8 +2349,7 @@ def test_rpath_args_script(self): """Test rpath_args.py script""" # $LIBRARY_PATH affects result of rpath_args.py, so make sure it's not set - if 'LIBRARY_PATH' in os.environ: - del os.environ['LIBRARY_PATH'] + os.environ.pop('LIBRARY_PATH', None) script = find_eb_script('rpath_args.py') diff --git a/test/framework/toolchainvariables.py b/test/framework/toolchainvariables.py index db90378d8b..e61bb9031c 100644 --- a/test/framework/toolchainvariables.py +++ b/test/framework/toolchainvariables.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/toy_build.py b/test/framework/toy_build.py index 61a9cca2e5..121bb43367 100644 --- a/test/framework/toy_build.py +++ b/test/framework/toy_build.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -366,8 +366,7 @@ def test_toy_tweaked(self): expected += "oh hai!" # setting $LMOD_QUIET results in suppression of printed message with Lmod & module files in Tcl syntax - if 'LMOD_QUIET' in os.environ: - del os.environ['LMOD_QUIET'] + os.environ.pop('LMOD_QUIET', None) self.modtool.use(os.path.join(self.test_installpath, 'modules', 'all')) out = self.modtool.run_module('load', 'toy/0.0-tweaked', return_output=True) diff --git a/test/framework/tweak.py b/test/framework/tweak.py index eda8046d52..24ec85b2c8 100644 --- a/test/framework/tweak.py +++ b/test/framework/tweak.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/type_checking.py b/test/framework/type_checking.py index e52c3da603..ded577ef69 100644 --- a/test/framework/type_checking.py +++ b/test/framework/type_checking.py @@ -1,5 +1,5 @@ # # -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/utilities.py b/test/framework/utilities.py index b32a5fd06a..e712e678a7 100644 --- a/test/framework/utilities.py +++ b/test/framework/utilities.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -207,8 +207,7 @@ def disallow_deprecated_behaviour(self): def allow_deprecated_behaviour(self): """Restore EasyBuild version to what it was originally, to allow triggering deprecated behaviour.""" - if 'EASYBUILD_DEPRECATED' in os.environ: - del os.environ['EASYBUILD_DEPRECATED'] + os.environ.pop('EASYBUILD_DEPRECATED', None) eb_build_log.CURRENT_VERSION = self.orig_current_version @contextmanager @@ -278,8 +277,7 @@ def reset_modulepath(self, modpaths): # make very sure $MODULEPATH is totally empty # some paths may be left behind, e.g. when they contain environment variables # example: "module unuse Modules/$MODULE_VERSION/modulefiles" may not yield the desired result - if 'MODULEPATH' in os.environ: - del os.environ['MODULEPATH'] + os.environ.pop('MODULEPATH', None) for modpath in modpaths: self.modtool.add_module_path(modpath, set_mod_paths=False) self.modtool.set_mod_paths() diff --git a/test/framework/utilities_test.py b/test/framework/utilities_test.py index 2e862e6ad6..c49b73ba0b 100644 --- a/test/framework/utilities_test.py +++ b/test/framework/utilities_test.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/framework/variables.py b/test/framework/variables.py index 8331a6c2dd..cc804d6a65 100644 --- a/test/framework/variables.py +++ b/test/framework/variables.py @@ -1,5 +1,5 @@ # # -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),