Skip to content

Commit 51159bf

Browse files
committed
Merge branch 'develop' into 5.0.x
2 parents f486168 + 7bebf0a commit 51159bf

File tree

5 files changed

+241
-3
lines changed

5 files changed

+241
-3
lines changed

RELEASE_NOTES

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@ For more detailed information, please see the git log.
44
These release notes can also be consulted at https://easybuild.readthedocs.io/en/latest/Release_notes.html.
55

66

7+
v4.9.0 (30 December 2023)
8+
-------------------------
9+
10+
feature release
11+
12+
- various enhancements, including:
13+
- allow tweaking of easyconfigs from different toolchains (#3669)
14+
- add support for `--list-software --output-format=json` (#4152)
15+
- add `--module-cache-suffix` configuration setting to allow multiple (Lmod) caches (#4403)
16+
- various bug fixes, including:
17+
- deduplicate warnings & errors found in logs and add initial newline + tab in output (#4361)
18+
- fix support for Environment Modules as modules tool to pass unit tests with v4.2+ (#4369)
19+
- adapt module function check for Environment Modules v4+ (#4371)
20+
- only install GitHub token when testing with Lmod 8.x + Python 3.6 or 3.9 (#4375)
21+
- use `-qopenmp` instead of `-fiopenmp` for OpenMP in Intel compilers (#4377)
22+
- fix `LIBBLAS_MT` for FlexiBLAS, ensure `-lpthread` is included (#4379)
23+
- relax major version match regex in `find_related_easyconfigs` using for `--review-pr` (#4385)
24+
- eliminate duplicate multideps from generated module files (#4386)
25+
- resolve templated values in extension names in `_make_extension_list` (#4392)
26+
- use source toolchain version when passing only `--try-toolchain` (#4395)
27+
- fix writing spider cache for Lmod >= 8.7.12 (#4402)
28+
- fix `--inject-checksums` when extension specifies patch file in tuple format (#4405)
29+
- fix `LooseVersion` when running with Python 2.7 (#4408)
30+
- use more recent easyblocks PR in `test_github_merge_pr` (#4414)
31+
- other changes:
32+
- extend test that checks build environment to recent `foss/2023a` toolchain (#4391)
33+
34+
735
v4.8.2 (29 October 2023)
836
------------------------
937

easybuild/framework/easyblock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4651,7 +4651,7 @@ def inject_checksums(ecs, checksum_type):
46514651
def make_list_lines(values, indent_level):
46524652
"""Make lines for list of values."""
46534653
def to_str(s):
4654-
if isinstance(s, string_type):
4654+
if isinstance(s, str):
46554655
return "'%s'" % s
46564656
else:
46574657
return str(s)

easybuild/tools/docs.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"""
3939
import copy
4040
import inspect
41+
import json
4142
import os
4243
from collections import OrderedDict
4344
from easybuild.tools import LooseVersion
@@ -73,6 +74,7 @@
7374
DETAILED = 'detailed'
7475
SIMPLE = 'simple'
7576

77+
FORMAT_JSON = 'json'
7678
FORMAT_MD = 'md'
7779
FORMAT_RST = 'rst'
7880
FORMAT_TXT = 'txt'
@@ -116,6 +118,11 @@ def avail_cfgfile_constants(go_cfg_constants, output_format=FORMAT_TXT):
116118
return generate_doc('avail_cfgfile_constants_%s' % output_format, [go_cfg_constants])
117119

118120

121+
def avail_cfgfile_constants_json(go_cfg_constants):
122+
"""Generate documentation on constants for configuration files in json format"""
123+
raise NotImplementedError("JSON output format not supported for avail_cfgfile_constants_json")
124+
125+
119126
def avail_cfgfile_constants_txt(go_cfg_constants):
120127
"""Generate documentation on constants for configuration files in txt format"""
121128
doc = [
@@ -185,6 +192,11 @@ def avail_easyconfig_constants(output_format=FORMAT_TXT):
185192
return generate_doc('avail_easyconfig_constants_%s' % output_format, [])
186193

187194

195+
def avail_easyconfig_constants_json():
196+
"""Generate easyconfig constant documentation in json format"""
197+
raise NotImplementedError("JSON output format not supported for avail_easyconfig_constants_json")
198+
199+
188200
def avail_easyconfig_constants_txt():
189201
"""Generate easyconfig constant documentation in txt format"""
190202
doc = ["Constants that can be used in easyconfigs"]
@@ -243,6 +255,11 @@ def avail_easyconfig_licenses(output_format=FORMAT_TXT):
243255
return generate_doc('avail_easyconfig_licenses_%s' % output_format, [])
244256

245257

258+
def avail_easyconfig_licenses_json():
259+
"""Generate easyconfig license documentation in json format"""
260+
raise NotImplementedError("JSON output format not supported for avail_easyconfig_licenses_json")
261+
262+
246263
def avail_easyconfig_licenses_txt():
247264
"""Generate easyconfig license documentation in txt format"""
248265
doc = ["License constants that can be used in easyconfigs"]
@@ -355,6 +372,13 @@ def avail_easyconfig_params_rst(title, grouped_params):
355372
return '\n'.join(doc)
356373

357374

375+
def avail_easyconfig_params_json():
376+
"""
377+
Compose overview of available easyconfig parameters, in json format.
378+
"""
379+
raise NotImplementedError("JSON output format not supported for avail_easyconfig_params_json")
380+
381+
358382
def avail_easyconfig_params_txt(title, grouped_params):
359383
"""
360384
Compose overview of available easyconfig parameters, in plain text format.
@@ -427,6 +451,11 @@ def avail_easyconfig_templates(output_format=FORMAT_TXT):
427451
return generate_doc('avail_easyconfig_templates_%s' % output_format, [])
428452

429453

454+
def avail_easyconfig_templates_json():
455+
""" Returns template documentation in json text format """
456+
raise NotImplementedError("JSON output format not supported for avail_easyconfig_templates")
457+
458+
430459
def avail_easyconfig_templates_txt():
431460
""" Returns template documentation in plain text format """
432461
# This has to reflect the methods/steps used in easyconfig _generate_template_values
@@ -641,6 +670,8 @@ def avail_classes_tree(classes, class_names, locations, detailed, format_strings
641670

642671

643672
def list_easyblocks(list_easyblocks=SIMPLE, output_format=FORMAT_TXT):
673+
if output_format == FORMAT_JSON:
674+
raise NotImplementedError("JSON output format not supported for list_easyblocks")
644675
format_strings = {
645676
FORMAT_MD: {
646677
'det_root_templ': "- **%s** (%s%s)",
@@ -1025,6 +1056,38 @@ def list_software_txt(software, detailed=False):
10251056
return '\n'.join(lines)
10261057

10271058

1059+
def list_software_json(software, detailed=False):
1060+
"""
1061+
Return overview of supported software in json
1062+
1063+
:param software: software information (strucuted like list_software does)
1064+
:param detailed: whether or not to return detailed information (incl. version, versionsuffix, toolchain info)
1065+
:return: multi-line string presenting requested info
1066+
"""
1067+
lines = ['[']
1068+
for key in sorted(software, key=lambda x: x.lower()):
1069+
for entry in software[key]:
1070+
if detailed:
1071+
# deep copy here to avoid modifying the original dict
1072+
entry = copy.deepcopy(entry)
1073+
entry['description'] = ' '.join(entry['description'].split('\n')).strip()
1074+
else:
1075+
entry = {}
1076+
entry['name'] = key
1077+
1078+
lines.append(json.dumps(entry, indent=4, sort_keys=True, separators=(',', ': ')) + ",")
1079+
if not detailed:
1080+
break
1081+
1082+
# remove trailing comma on last line
1083+
if len(lines) > 1:
1084+
lines[-1] = lines[-1].rstrip(',')
1085+
1086+
lines.append(']')
1087+
1088+
return '\n'.join(lines)
1089+
1090+
10281091
def list_toolchains(output_format=FORMAT_TXT):
10291092
"""Show list of known toolchains."""
10301093
_, all_tcs = search_toolchain('')
@@ -1173,6 +1236,11 @@ def list_toolchains_txt(tcs):
11731236
return '\n'.join(doc)
11741237

11751238

1239+
def list_toolchains_json(tcs):
1240+
""" Returns overview of all toolchains in json format """
1241+
raise NotImplementedError("JSON output not implemented yet for --list-toolchains")
1242+
1243+
11761244
def avail_toolchain_opts(name, output_format=FORMAT_TXT):
11771245
"""Show list of known options for given toolchain."""
11781246
tc_class, _ = search_toolchain(name)
@@ -1226,6 +1294,11 @@ def avail_toolchain_opts_rst(name, tc_dict):
12261294
return '\n'.join(doc)
12271295

12281296

1297+
def avail_toolchain_opts_json(name, tc_dict):
1298+
""" Returns overview of toolchain options in jsonformat """
1299+
raise NotImplementedError("JSON output not implemented yet for --avail-toolchain-opts")
1300+
1301+
12291302
def avail_toolchain_opts_txt(name, tc_dict):
12301303
""" Returns overview of toolchain options in txt format """
12311304
doc = ["Available options for %s toolchain:" % name]
@@ -1252,6 +1325,13 @@ def get_easyblock_classes(package_name):
12521325
return easyblocks
12531326

12541327

1328+
def gen_easyblocks_overview_json(package_name, path_to_examples, common_params=None, doc_functions=None):
1329+
"""
1330+
Compose overview of all easyblocks in the given package in json format
1331+
"""
1332+
raise NotImplementedError("JSON output not implemented yet for gen_easyblocks_overview")
1333+
1334+
12551335
def gen_easyblocks_overview_md(package_name, path_to_examples, common_params=None, doc_functions=None):
12561336
"""
12571337
Compose overview of all easyblocks in the given package in MarkDown format

easybuild/tools/options.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
from easybuild.tools.config import get_pretend_installpath, init, init_build_options, mk_full_default_path
8080
from easybuild.tools.config import BuildOptions, ConfigurationVariables
8181
from easybuild.tools.configobj import ConfigObj, ConfigObjError
82-
from easybuild.tools.docs import FORMAT_MD, FORMAT_RST, FORMAT_TXT
82+
from easybuild.tools.docs import FORMAT_JSON, FORMAT_MD, FORMAT_RST, FORMAT_TXT
8383
from easybuild.tools.docs import avail_cfgfile_constants, avail_easyconfig_constants, avail_easyconfig_licenses
8484
from easybuild.tools.docs import avail_toolchain_opts, avail_easyconfig_params, avail_easyconfig_templates
8585
from easybuild.tools.docs import list_easyblocks, list_toolchains
@@ -466,7 +466,8 @@ def override_options(self):
466466
'mpi-tests': ("Run MPI tests (when relevant)", None, 'store_true', True),
467467
'optarch': ("Set architecture optimization, overriding native architecture optimizations",
468468
None, 'store', None),
469-
'output-format': ("Set output format", 'choice', 'store', FORMAT_TXT, [FORMAT_MD, FORMAT_RST, FORMAT_TXT]),
469+
'output-format': ("Set output format", 'choice', 'store', FORMAT_TXT,
470+
[FORMAT_JSON, FORMAT_MD, FORMAT_RST, FORMAT_TXT]),
470471
'output-style': ("Control output style; auto implies using Rich if available to produce rich output, "
471472
"with fallback to basic colored output",
472473
'choice', 'store', OUTPUT_STYLE_AUTO, OUTPUT_STYLES),

0 commit comments

Comments
 (0)