Skip to content

Commit fc9e616

Browse files
committed
Merge branch '5.0.x' of github.com:easybuilders/easybuild-framework into 5.0.x
2 parents 035699c + 128505f commit fc9e616

File tree

122 files changed

+3557
-4642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+3557
-4642
lines changed

.github/workflows/container_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
ls dist
7575
export PREFIX=/tmp/$USER/$GITHUB_SHA
7676
pip install --prefix $PREFIX dist/easybuild-framework*tar.gz
77-
pip install --prefix $PREFIX https://github.com/easybuilders/easybuild-easyblocks/archive/develop.tar.gz
77+
pip install --prefix $PREFIX https://github.com/easybuilders/easybuild-easyblocks/archive/5.0.x.tar.gz
7878
7979
- name: run test
8080
run: |
@@ -95,7 +95,7 @@ jobs:
9595
echo '%_dbpath %{_var}/lib/rpm' >> $HOME/.rpmmacros
9696
# build CentOS 7 container image for bzip2 1.0.8 using EasyBuild;
9797
# see https://docs.easybuild.io/en/latest/Containers.html
98-
curl -OL https://raw.githubusercontent.com/easybuilders/easybuild-easyconfigs/develop/easybuild/easyconfigs/b/bzip2/bzip2-1.0.8.eb
98+
curl -OL https://raw.githubusercontent.com/easybuilders/easybuild-easyconfigs/5.0.x/easybuild/easyconfigs/b/bzip2/bzip2-1.0.8.eb
9999
export EASYBUILD_CONTAINERPATH=$PWD
100100
export EASYBUILD_CONTAINER_CONFIG='bootstrap=docker,from=ghcr.io/easybuilders/centos-7.9-python3-amd64'
101101
eb bzip2-1.0.8.eb --containerize --experimental --container-build-image

.github/workflows/container_tests_apptainer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
ls dist
7575
export PREFIX=/tmp/$USER/$GITHUB_SHA
7676
pip install --prefix $PREFIX dist/easybuild-framework*tar.gz
77-
pip install --prefix $PREFIX https://github.com/easybuilders/easybuild-easyblocks/archive/develop.tar.gz
77+
pip install --prefix $PREFIX https://github.com/easybuilders/easybuild-easyblocks/archive/5.0.x.tar.gz
7878
7979
- name: run test
8080
run: |
@@ -95,7 +95,7 @@ jobs:
9595
echo '%_dbpath %{_var}/lib/rpm' >> $HOME/.rpmmacros
9696
# build CentOS 7 container image for bzip2 1.0.8 using EasyBuild;
9797
# see https://docs.easybuild.io/en/latest/Containers.html
98-
curl -OL https://raw.githubusercontent.com/easybuilders/easybuild-easyconfigs/develop/easybuild/easyconfigs/b/bzip2/bzip2-1.0.8.eb
98+
curl -OL https://raw.githubusercontent.com/easybuilders/easybuild-easyconfigs/5.0.x/easybuild/easyconfigs/b/bzip2/bzip2-1.0.8.eb
9999
export EASYBUILD_CONTAINERPATH=$PWD
100100
export EASYBUILD_CONTAINER_CONFIG='bootstrap=docker,from=ghcr.io/easybuilders/centos-7.9-python3-amd64'
101101
export EASYBUILD_CONTAINER_TYPE='apptainer'

.github/workflows/eb_command.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-20.04
1515
strategy:
1616
matrix:
17-
python: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
17+
python: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
1818
fail-fast: false
1919
steps:
2020
- uses: actions/checkout@v3
@@ -91,7 +91,7 @@ jobs:
9191
pymajver=$(python -c 'import sys; print(sys.version_info[0])')
9292
pymajminver=$(python -c 'import sys; print(".".join(str(x) for x in sys.version_info[:2]))')
9393
# check patterns in verbose output
94-
for pattern in "^>> Considering .python.\.\.\." "^>> .python. version: ${pymajminver}\.[0-9]\+, which matches Python ${pymajver} version requirement" "^>> 'python' is able to import 'easybuild.framework', so retaining it" "^>> Selected Python command: python \(.*/bin/python\)" "^This is EasyBuild 4\.[0-9.]\+"; do
94+
for pattern in "^>> Considering .python3.\.\.\." "^>> .python3. version: ${pymajminver}\.[0-9]\+, which matches Python ${pymajver} version requirement" "^>> 'python3' is able to import 'easybuild.framework', so retaining it" "^>> Selected Python command: python3 \(.*/bin/python3\)" "^This is EasyBuild 5\.[0-9.]\+"; do
9595
echo "Looking for pattern \"${pattern}\" in eb_version.out..."
9696
grep "$pattern" eb_version.out
9797
done
@@ -103,7 +103,7 @@ jobs:
103103
for eb_python in "python${pymajver}" "python${pymajminver}"; do
104104
export EB_PYTHON="${eb_python}"
105105
eb --version | tee eb_version.out 2>&1
106-
for pattern in "^>> Considering .${eb_python}.\.\.\." "^>> .${eb_python}. version: ${pymajminver}\.[0-9]\+, which matches Python ${pymajver} version requirement" "^>> '${eb_python}' is able to import 'easybuild.framework', so retaining it" "^>> Selected Python command: ${eb_python} \(.*/bin/${eb_python}\)" "^This is EasyBuild 4\.[0-9.]\+"; do
106+
for pattern in "^>> Considering .${eb_python}.\.\.\." "^>> .${eb_python}. version: ${pymajminver}\.[0-9]\+, which matches Python ${pymajver} version requirement" "^>> '${eb_python}' is able to import 'easybuild.framework', so retaining it" "^>> Selected Python command: ${eb_python} \(.*/bin/${eb_python}\)" "^This is EasyBuild 5\.[0-9.]\+"; do
107107
echo "Looking for pattern \"${pattern}\" in eb_version.out..."
108108
grep "$pattern" eb_version.out
109109
done

.github/workflows/end2end.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ jobs:
77
strategy:
88
matrix:
99
container:
10-
- centos-7.9
1110
- centos-8.5
1211
- fedora-36
1312
- opensuse-15.4
@@ -26,17 +25,17 @@ jobs:
2625
run: |
2726
cd $HOME
2827
for pkg in easyblocks easyconfigs; do
29-
curl -OL https://github.com/easybuilders/easybuild-${pkg}/archive/develop.tar.gz
30-
tar xfz develop.tar.gz
31-
rm -f develop.tar.gz
28+
curl -OL https://github.com/easybuilders/easybuild-${pkg}/archive/5.0.x.tar.gz
29+
tar xfz 5.0.x.tar.gz
30+
rm -f 5.0.x.tar.gz
3231
done
3332
3433
- name: Set up environment
3534
shell: bash
3635
run: |
3736
# collect environment variables to be set in subsequent steps in script that can be sourced
3837
echo "export PATH=$PWD:$PATH" > /tmp/eb_env
39-
echo "export PYTHONPATH=$PWD:$HOME/easybuild-easyblocks-develop:$HOME/easybuild-easyconfigs-develop" >> /tmp/eb_env
38+
echo "export PYTHONPATH=$PWD:$HOME/easybuild-easyblocks-5.0.x:$HOME/easybuild-easyconfigs-5.0.x" >> /tmp/eb_env
4039
4140
- name: Run commands to check test environment
4241
shell: bash

.github/workflows/linting.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-20.04
1414
strategy:
1515
matrix:
16-
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
16+
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
1717

1818
steps:
1919
- uses: actions/checkout@v3
@@ -30,10 +30,4 @@ jobs:
3030
3131
- name: Run flake8 to verify PEP8-compliance of Python code
3232
run: |
33-
# don't check py2vs3/py3.py when testing with Python 2, and vice versa
34-
if [[ "${{ matrix.python-version }}" =~ "2." ]]; then
35-
py_excl=py3
36-
else
37-
py_excl=py2
38-
fi
39-
flake8 --exclude ./easybuild/tools/py2vs3/${py_excl}.py
33+
flake8

.github/workflows/unit_tests.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ jobs:
1313
setup:
1414
runs-on: ubuntu-20.04
1515
outputs:
16-
lmod7: Lmod-7.8.22
1716
lmod8: Lmod-8.7.6
18-
modulesTcl: modules-tcl-1.147
19-
modules3: modules-3.2.10
2017
modules4: modules-4.1.4
2118
steps:
2219
- run: "true"
@@ -29,16 +26,11 @@ jobs:
2926
modules_tool:
3027
# use variables defined by 'setup' job above, see also
3128
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
32-
- ${{needs.setup.outputs.lmod7}}
3329
- ${{needs.setup.outputs.lmod8}}
34-
- ${{needs.setup.outputs.modulesTcl}}
35-
- ${{needs.setup.outputs.modules3}}
3630
- ${{needs.setup.outputs.modules4}}
3731
lc_all: [""]
3832
include:
39-
# Test different Python 3 versions with Lmod 8.x
40-
- python: 3.5
41-
modules_tool: ${{needs.setup.outputs.lmod8}}
33+
# Test different Python 3 versions with Lmod 8.x (with both Lua and Tcl module syntax)
4234
- python: 3.7
4335
modules_tool: ${{needs.setup.outputs.lmod8}}
4436
- python: 3.8
@@ -160,11 +152,7 @@ jobs:
160152
export PYTHONPATH=$PREFIX/lib/python${{matrix.python}}/site-packages:$PYTHONPATH
161153
eb --version
162154
# tell EasyBuild which modules tool is available
163-
if [[ ${{matrix.modules_tool}} =~ ^modules-tcl- ]]; then
164-
export EASYBUILD_MODULES_TOOL=EnvironmentModulesTcl
165-
elif [[ ${{matrix.modules_tool}} =~ ^modules-3 ]]; then
166-
export EASYBUILD_MODULES_TOOL=EnvironmentModulesC
167-
elif [[ ${{matrix.modules_tool}} =~ ^modules-4 ]]; then
155+
if [[ ${{matrix.modules_tool}} =~ ^modules-4 ]]; then
168156
export EASYBUILD_MODULES_TOOL=EnvironmentModules
169157
else
170158
export EASYBUILD_MODULES_TOOL=Lmod

.github/workflows/unit_tests_python2.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

easybuild/base/fancylogger.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
import weakref
8888

8989
from easybuild.tools import LooseVersion
90-
from easybuild.tools.py2vs3 import raise_with_traceback, string_type
9190

9291

9392
def _env_to_boolean(varname, default=False):
@@ -214,11 +213,11 @@ class MissingLevelName(KeyError):
214213

215214
def getLevelInt(level_name):
216215
"""Given a level name, return the int value"""
217-
if not isinstance(level_name, string_type):
216+
if not isinstance(level_name, str):
218217
raise TypeError('Provided name %s is not a string (type %s)' % (level_name, type(level_name)))
219218

220219
level = logging.getLevelName(level_name)
221-
if isinstance(level, string_type):
220+
if isinstance(level, str):
222221
raise MissingLevelName('Unknown loglevel name %s' % level_name)
223222

224223
return level
@@ -328,7 +327,7 @@ def raiseException(self, message, exception=None, catch=False):
328327
exception = self.RAISE_EXCEPTION_CLASS
329328

330329
self.RAISE_EXCEPTION_LOG_METHOD(fullmessage)
331-
raise_with_traceback(exception, message, tb)
330+
raise exception(message).with_traceback(tb)
332331

333332
# pylint: disable=unused-argument
334333
def deprecated(self, msg, cur_ver, max_ver, depth=2, exception=None, log_callback=None, *args, **kwargs):
@@ -588,7 +587,7 @@ def logToFile(filename, enable=True, filehandler=None, name=None, max_bytes=MAX_
588587
os.makedirs(directory)
589588
except Exception as ex:
590589
exc, detail, tb = sys.exc_info()
591-
raise_with_traceback(exc, "Cannot create logdirectory %s: %s \n detail: %s" % (directory, ex, detail), tb)
590+
raise exc("Cannot create logdirectory %s: %s \n detail: %s" % (directory, ex, detail)).with_traceback(tb)
592591

593592
return _logToSomething(
594593
logging.handlers.RotatingFileHandler,
@@ -741,7 +740,7 @@ def setLogLevel(level):
741740
"""
742741
Set a global log level for all FancyLoggers
743742
"""
744-
if isinstance(level, string_type):
743+
if isinstance(level, str):
745744
level = getLevelInt(level)
746745
logger = getLogger(fname=False, clsname=False)
747746
logger.setLevel(level)

easybuild/base/frozendict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
It can be used as a drop-in replacement for dictionaries where immutability is desired.
2222
"""
2323
import operator
24+
from collections.abc import Mapping
2425
from functools import reduce
2526

2627
from easybuild.base import fancylogger
27-
from easybuild.tools.py2vs3 import Mapping
2828

2929

3030
# minor adjustments:

easybuild/base/generaloption.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* Jens Timmerman (Ghent University)
3232
"""
3333

34+
import configparser
3435
import copy
3536
import difflib
3637
import inspect
@@ -39,13 +40,15 @@
3940
import re
4041
import sys
4142
import textwrap
43+
from configparser import ConfigParser
4244
from functools import reduce
45+
from io import StringIO
4346
from optparse import Option, OptionGroup, OptionParser, OptionValueError, Values
4447
from optparse import SUPPRESS_HELP as nohelp # supported in optparse of python v2.4
4548

4649
from easybuild.base.fancylogger import getLogger, setroot, setLogLevel, getDetailsLogLevels
4750
from easybuild.base.optcomplete import autocomplete, CompleterOption
48-
from easybuild.tools.py2vs3 import StringIO, configparser, ConfigParser, string_type, subprocess_popen_text
51+
from easybuild.tools.run import subprocess_popen_text
4952
from easybuild.tools.utilities import mk_md_table, mk_rst_table, nub, shell_quote
5053

5154
try:
@@ -133,7 +136,7 @@ def get_empty_add_flex(allvalues, self=None):
133136
empty = None
134137

135138
if isinstance(allvalues, (list, tuple)):
136-
if isinstance(allvalues[0], string_type):
139+
if isinstance(allvalues[0], str):
137140
empty = ''
138141

139142
if empty is None:
@@ -464,7 +467,7 @@ def is_value_a_commandline_option(self, opt, value, index=None):
464467
# --longopt=value, so no issues there either.
465468

466469
# following checks assume that value is a string (not a store_or_None)
467-
if not isinstance(value, string_type):
470+
if not isinstance(value, str):
468471
return None
469472

470473
cmdline_index = None
@@ -1191,7 +1194,7 @@ def add_group_parser(self, opt_dict, description, prefix=None, otherdefaults=Non
11911194
# choices
11921195
nameds['choices'] = [str(x) for x in extra_detail] # force to strings
11931196
hlp += ' (choices: %s)' % ', '.join(nameds['choices'])
1194-
elif isinstance(extra_detail, string_type) and len(extra_detail) == 1:
1197+
elif isinstance(extra_detail, str) and len(extra_detail) == 1:
11951198
args.insert(0, "-%s" % extra_detail)
11961199
elif isinstance(extra_detail, (dict,)):
11971200
# extract any optcomplete completer hints
@@ -1708,7 +1711,7 @@ class SimpleOption(GeneralOption):
17081711
PARSER = SimpleOptionParser
17091712
SETROOTLOGGER = True
17101713

1711-
def __init__(self, go_dict=None, descr=None, short_groupdescr=None, long_groupdescr=None, config_files=None):
1714+
def __init__(self, go_dict=None, short_groupdescr=None, long_groupdescr=None, config_files=None):
17121715
"""Initialisation
17131716
:param go_dict: General Option option dict
17141717
:param short_groupdescr: short description of main options
@@ -1737,18 +1740,13 @@ def __init__(self, go_dict=None, descr=None, short_groupdescr=None, long_groupde
17371740

17381741
super(SimpleOption, self).__init__(**kwargs)
17391742

1740-
if descr is not None:
1741-
# TODO: as there is no easy/clean way to access the version of the vsc-base package,
1742-
# this is equivalent to a warning
1743-
self.log.deprecated('SimpleOption descr argument', '2.5.0', '3.0.0')
1744-
17451743
def main_options(self):
17461744
if self.go_dict is not None:
17471745
prefix = None
17481746
self.add_group_parser(self.go_dict, self.descr, prefix=prefix)
17491747

17501748

1751-
def simple_option(go_dict=None, descr=None, short_groupdescr=None, long_groupdescr=None, config_files=None):
1749+
def simple_option(go_dict=None, short_groupdescr=None, long_groupdescr=None, config_files=None):
17521750
"""A function that returns a single level GeneralOption option parser
17531751
17541752
:param go_dict: General Option option dict
@@ -1762,5 +1760,5 @@ def simple_option(go_dict=None, descr=None, short_groupdescr=None, long_groupdes
17621760
17631761
the generated help will include the docstring
17641762
"""
1765-
return SimpleOption(go_dict=go_dict, descr=descr, short_groupdescr=short_groupdescr,
1766-
long_groupdescr=long_groupdescr, config_files=config_files)
1763+
return SimpleOption(go_dict=go_dict, short_groupdescr=short_groupdescr, long_groupdescr=long_groupdescr,
1764+
config_files=config_files)

0 commit comments

Comments
 (0)