Skip to content

Commit 3d21594

Browse files
authored
Merge pull request #3681 from Flamefire/super-calls
Remove Python2 style `super()`-calls and fix ExtensionEasyBlock
2 parents aa044df + 02b00e7 commit 3d21594

File tree

222 files changed

+728
-727
lines changed

Some content is hidden

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

222 files changed

+728
-727
lines changed

easybuild/easyblocks/a/abaqus.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def extra_options():
6060

6161
def __init__(self, *args, **kwargs):
6262
"""Initialisation of custom class variables for ABAQUS."""
63-
super(EB_ABAQUS, self).__init__(*args, **kwargs)
63+
super().__init__(*args, **kwargs)
6464
self.replayfile = None
6565

6666
if self.cfg['with_tosca'] is None and LooseVersion(self.version) >= LooseVersion('2020'):
@@ -222,7 +222,7 @@ def install_step(self):
222222
self.cfg['install_cmd'] += " -replay %s" % self.replayfile
223223
if LooseVersion(self.version) < LooseVersion("6.13"):
224224
self.cfg['install_cmd'] += " -nosystemcheck"
225-
super(EB_ABAQUS, self).install_step()
225+
super().install_step()
226226

227227
if LooseVersion(self.version) >= LooseVersion('2016'):
228228
# also install hot fixes (if any)
@@ -357,11 +357,11 @@ def sanity_check_step(self):
357357
if self.cfg['with_tosca']:
358358
custom_commands.append("ToscaPython.sh --help")
359359

360-
super(EB_ABAQUS, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
360+
super().sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
361361

362362
def make_module_extra(self):
363363
"""Add LM_LICENSE_FILE path if specified"""
364-
txt = super(EB_ABAQUS, self).make_module_extra()
364+
txt = super().make_module_extra()
365365
license_file = os.getenv('EB_ABAQUS_LICENSE_FILE', None)
366366
if license_file is not None:
367367
txt += self.module_generator.prepend_paths('ABAQUSLM_LICENSE_FILE', [license_file], allow_abs=True)

easybuild/easyblocks/a/adf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ class EB_ADF(EasyBlock):
4141

4242
def __init__(self, *args, **kwargs):
4343
"""Initialisation of custom class variables for ADF."""
44-
super(EB_ADF, self).__init__(*args, **kwargs)
44+
super().__init__(*args, **kwargs)
4545

4646
self.build_in_installdir = True
4747

4848
def extract_step(self):
4949
"""Extract sources."""
5050
# strip off 'adf<version>' part to avoid having everything in a subdirectory
5151
self.cfg['unpack_options'] = "--strip-components=1"
52-
super(EB_ADF, self).extract_step()
52+
super().extract_step()
5353

5454
def configure_step(self):
5555
"""Custom configuration procedure for ADF."""
@@ -89,11 +89,11 @@ def sanity_check_step(self):
8989
'files': ['bin/adf'],
9090
'dirs': ['atomicdata', 'examples'],
9191
}
92-
super(EB_ADF, self).sanity_check_step(custom_paths=custom_paths)
92+
super().sanity_check_step(custom_paths=custom_paths)
9393

9494
def make_module_extra(self):
9595
"""Custom extra module file entries for ADF."""
96-
txt = super(EB_ADF, self).make_module_extra()
96+
txt = super().make_module_extra()
9797

9898
txt += self.module_generator.set_environment('ADFHOME', self.installdir)
9999
txt += self.module_generator.set_environment('ADFBIN', os.path.join(self.installdir, 'bin'))

easybuild/easyblocks/a/advisor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class EB_Advisor(IntelBase):
4545

4646
def __init__(self, *args, **kwargs):
4747
"""Constructor, initialize class variables."""
48-
super(EB_Advisor, self).__init__(*args, **kwargs)
48+
super().__init__(*args, **kwargs)
4949

5050
if LooseVersion(self.version) < LooseVersion('2020'):
5151
raise EasyBuildError(
@@ -63,10 +63,10 @@ def __init__(self, *args, **kwargs):
6363
def prepare_step(self, *args, **kwargs):
6464
"""Since 2019u3 there is no license required."""
6565
kwargs['requires_runtime_license'] = False
66-
super(EB_Advisor, self).prepare_step(*args, **kwargs)
66+
super().prepare_step(*args, **kwargs)
6767

6868
def sanity_check_step(self):
6969
"""Custom sanity check paths for Advisor"""
7070
binaries = ['advixe-cl', 'advixe-feedback', 'advixe-gui', 'advixe-runss', 'advixe-runtrc', 'advixe-runtc']
7171
custom_paths = self.get_custom_paths_tools(binaries)
72-
super(EB_Advisor, self).sanity_check_step(custom_paths=custom_paths)
72+
super().sanity_check_step(custom_paths=custom_paths)

easybuild/easyblocks/a/aedt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class EB_AEDT(PackedBinary):
4343

4444
def __init__(self, *args, **kwargs):
4545
"""Initialize Ansys Electronics Desktop specific variables."""
46-
super(EB_AEDT, self).__init__(*args, **kwargs)
46+
super().__init__(*args, **kwargs)
4747
self.subdir = None
4848

4949
def _set_subdir(self):
@@ -120,7 +120,7 @@ def post_processing_step(self):
120120
def make_module_extra(self):
121121
"""Extra module entries for Ansys Electronics Desktop."""
122122

123-
txt = super(EB_AEDT, self).make_module_extra()
123+
txt = super().make_module_extra()
124124
ver = LooseVersion(self.version)
125125
short_ver = self.version[2:].replace('R', '')
126126

@@ -160,4 +160,4 @@ def sanity_check_step(self):
160160
inpfile = os.path.join(tempdir, 'sm-1.aedt')
161161
custom_commands = ['ansysedt -ng -batchsolve -Distributed -monitor %s' % inpfile]
162162

163-
super(EB_AEDT, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
163+
super().sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)

easybuild/easyblocks/a/amber.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def extra_options(extra_vars=None):
6868

6969
def __init__(self, *args, **kwargs):
7070
"""Easyblock constructor: initialise class variables."""
71-
super(EB_Amber, self).__init__(*args, **kwargs)
71+
super().__init__(*args, **kwargs)
7272

7373
if LooseVersion(self.version) < LooseVersion('20'):
7474
# Build Amber <20 in install directory
@@ -83,7 +83,7 @@ def __init__(self, *args, **kwargs):
8383
def extract_step(self):
8484
"""Extract sources; strip off parent directory during unpack"""
8585
self.cfg.update('unpack_options', "--strip-components=1")
86-
super(EB_Amber, self).extract_step()
86+
super().extract_step()
8787

8888
def patch_step(self, *args, **kwargs):
8989
"""Patch Amber using 'update_amber' tool, prior to applying listed patch files (if any)."""
@@ -118,7 +118,7 @@ def patch_step(self, *args, **kwargs):
118118
for _ in range(self.cfg['patchruns']):
119119
run_shell_cmd(cmd)
120120

121-
super(EB_Amber, self).patch_step(*args, **kwargs)
121+
super().patch_step(*args, **kwargs)
122122

123123
def configure_step(self):
124124
"""Apply the necessary CMake config opts."""
@@ -203,15 +203,15 @@ def configure_step(self):
203203
self.cfg.update('configopts', '-DCOMPILER=AUTO')
204204

205205
# configure using cmake
206-
super(EB_Amber, self).configure_step()
206+
super().configure_step()
207207

208208
def build_step(self):
209209
"""Build Amber"""
210210
if LooseVersion(self.version) < LooseVersion('20'):
211211
# Building Amber < 20 is done in install step.
212212
return
213213

214-
super(EB_Amber, self).build_step()
214+
super().build_step()
215215

216216
def test_step(self):
217217
"""Testing Amber build is done in install step."""
@@ -308,7 +308,7 @@ def configuremake_install_step(self):
308308

309309
# build in situ using 'make install'
310310
# note: not 'build'
311-
super(EB_Amber, self).install_step()
311+
super().install_step()
312312

313313
# test
314314
if self.cfg['runtest']:
@@ -325,7 +325,7 @@ def install_step(self):
325325
self.configuremake_install_step()
326326
return
327327

328-
super(EB_Amber, self).install_step()
328+
super().install_step()
329329

330330
# Run the tests located in the build directory
331331
if self.cfg['runtest']:
@@ -374,11 +374,11 @@ def sanity_check_step(self):
374374
'files': [os.path.join(self.installdir, 'bin', binary) for binary in binaries],
375375
'dirs': [],
376376
}
377-
super(EB_Amber, self).sanity_check_step(custom_paths=custom_paths)
377+
super().sanity_check_step(custom_paths=custom_paths)
378378

379379
def make_module_extra(self):
380380
"""Add module entries specific to Amber/AmberTools"""
381-
txt = super(EB_Amber, self).make_module_extra()
381+
txt = super().make_module_extra()
382382

383383
txt += self.module_generator.set_environment('AMBERHOME', self.installdir)
384384

easybuild/easyblocks/a/anaconda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ def sanity_check_step(self):
7777
'files': [os.path.join('bin', x) for x in ['2to3', 'conda', 'pydoc', 'python', 'sqlite3']],
7878
'dirs': ['bin', 'etc', 'lib', 'pkgs'],
7979
}
80-
super(EB_Anaconda, self).sanity_check_step(custom_paths=custom_paths)
80+
super().sanity_check_step(custom_paths=custom_paths)

easybuild/easyblocks/a/ansys.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class EB_ANSYS(PackedBinary):
4444

4545
def __init__(self, *args, **kwargs):
4646
"""Initialize ANSYS-specific variables."""
47-
super(EB_ANSYS, self).__init__(*args, **kwargs)
47+
super().__init__(*args, **kwargs)
4848
self.ansysver = None
4949

5050
# custom extra module environment entries for ANSYS
@@ -107,7 +107,7 @@ def make_module_extra(self):
107107
if self.ansysver is None:
108108
self.set_ansysver()
109109

110-
txt = super(EB_ANSYS, self).make_module_extra()
110+
txt = super().make_module_extra()
111111
icem_acn = os.path.join(self.installdir, self.ansysver, 'icemcfd', 'linux64_amd')
112112
txt += self.module_generator.set_environment('ICEM_ACN', icem_acn)
113113
return txt
@@ -122,4 +122,4 @@ def sanity_check_step(self):
122122
'files': [os.path.join(self.ansysver, 'fluent', 'bin', 'fluent%s' % x) for x in ['', '_arch', '_sysinfo']],
123123
'dirs': [os.path.join(self.ansysver, x) for x in ['ansys', 'aisol', 'CFD-Post', 'CFX']]
124124
}
125-
super(EB_ANSYS, self).sanity_check_step(custom_paths=custom_paths)
125+
super().sanity_check_step(custom_paths=custom_paths)

easybuild/easyblocks/a/aocc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def extra_options():
8080

8181
def __init__(self, *args, **kwargs):
8282
"""Easyblock constructor, define custom class variables specific to AOCC."""
83-
super(EB_AOCC, self).__init__(*args, **kwargs)
83+
super().__init__(*args, **kwargs)
8484

8585
self.clangversion = self.cfg['clangversion']
8686
# AOCC is based on Clang. Try to guess the clangversion from the AOCC version
@@ -209,7 +209,7 @@ def install_step(self):
209209
# or via 'accept_eula = True' in easyconfig file
210210
self.check_accepted_eula(more_info='http://developer.amd.com/wordpress/media/files/AOCC_EULA.pdf')
211211

212-
super(EB_AOCC, self).install_step()
212+
super().install_step()
213213

214214
def post_processing_step(self):
215215
"""
@@ -245,7 +245,7 @@ def post_processing_step(self):
245245

246246
self._create_compiler_config_files(compilers_to_add_config_files)
247247
self._create_compiler_wrappers(compilers_to_wrap)
248-
super(EB_AOCC, self).post_processing_step()
248+
super().post_processing_step()
249249

250250
def sanity_check_step(self):
251251
"""Custom sanity check for AOCC, based on sanity check for Clang."""
@@ -288,11 +288,11 @@ def sanity_check_step(self):
288288
minimal_f90_compiler_cmd = "cd %s && flang minimal.f90 -o minimal_f90" % tmpdir
289289
custom_commands.append(minimal_f90_compiler_cmd)
290290

291-
super(EB_AOCC, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
291+
super().sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
292292

293293
def make_module_extra(self):
294294
"""Custom variables for AOCC module."""
295-
txt = super(EB_AOCC, self).make_module_extra()
295+
txt = super().make_module_extra()
296296
# we set the symbolizer path so that asan/tsan give meanfull output by default
297297
asan_symbolizer_path = os.path.join(self.installdir, 'bin', 'llvm-symbolizer')
298298
txt += self.module_generator.set_environment('ASAN_SYMBOLIZER_PATH', asan_symbolizer_path)

easybuild/easyblocks/a/aomp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def extra_options():
6565

6666
def __init__(self, *args, **kwargs):
6767
"""Initialize custom class variables for Clang."""
68-
super(EB_AOMP, self).__init__(*args, **kwargs)
68+
super().__init__(*args, **kwargs)
6969
self.cfg['extract_sources'] = True
7070
self.cfg['dontcreateinstalldir'] = True
7171
# Bypass the .mod file check for GCCcore installs
@@ -130,7 +130,7 @@ def configure_step(self):
130130
self.cfg['installopts'] = 'select ' + ' '.join(components)
131131

132132
def post_processing_step(self):
133-
super(EB_AOMP, self).post_processing_step()
133+
super().post_processing_step()
134134
# The install script will create a symbolic link as the install
135135
# directory, this creates problems for EB as it won't remove the
136136
# symlink. To remedy this we remove the link here and rename the actual
@@ -190,4 +190,4 @@ def sanity_check_step(self):
190190
'aompcc --help', 'clang --help', 'clang++ --help', 'flang --help',
191191
'llvm-config --cxxflags',
192192
]
193-
super(EB_AOMP, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
193+
super().sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)

easybuild/easyblocks/a/armadillo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def configure_step(self):
5959
self.cfg.update('configopts', '-DBLAS_LIBRARY:PATH="%s"' % os.getenv('LIBBLAS'))
6060
self.cfg.update('configopts', '-DLAPACK_LIBRARY:PATH="%s"' % os.getenv('LIBLAPACK'))
6161

62-
super(EB_Armadillo, self).configure_step()
62+
super().configure_step()
6363

6464
def sanity_check_step(self):
6565
"""Custom sanity check for Armadillo."""
@@ -72,4 +72,4 @@ def sanity_check_step(self):
7272
'files': ['include/armadillo', os.path.join(libdir, 'libarmadillo.%s' % get_shared_lib_ext())],
7373
'dirs': ['include/armadillo_bits'],
7474
}
75-
super(EB_Armadillo, self).sanity_check_step(custom_paths=custom_paths)
75+
super().sanity_check_step(custom_paths=custom_paths)

0 commit comments

Comments
 (0)