From cf2494c579d85fd96e9fd738f99c8f69a01ca5ad Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:20:56 +0200 Subject: [PATCH 01/28] fix flakes for u and v --- easybuild/easyblocks/u/ufc.py | 2 +- easybuild/easyblocks/v/velvet.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/u/ufc.py b/easybuild/easyblocks/u/ufc.py index 8897058faf..92cef99a19 100644 --- a/easybuild/easyblocks/u/ufc.py +++ b/easybuild/easyblocks/u/ufc.py @@ -56,7 +56,7 @@ def configure_step(self): if not deproot: raise EasyBuildError("%s module not loaded?", dep) else: - depsdict.update({dep:deproot}) + depsdict.update({dep: deproot}) # SWIG version more recent than 2.0.4 have a regression # which causes problems with e.g. DOLFIN if UFC was built with it diff --git a/easybuild/easyblocks/v/velvet.py b/easybuild/easyblocks/v/velvet.py index 23e5a54728..136e357d5c 100644 --- a/easybuild/easyblocks/v/velvet.py +++ b/easybuild/easyblocks/v/velvet.py @@ -39,7 +39,11 @@ def install_step(self): srcdir = self.cfg['start_dir'] destdir = os.path.join(self.installdir, 'bin') srcfile = None - # Get executable files: for i in $(find . -maxdepth 1 -type f -perm +111 -print | sed -e 's/\.\///g' | awk '{print "\""$0"\""}' | grep -vE "\.sh|\.html"); do echo -ne "$i, "; done && echo + # Get executable files: + # for i in $(find . -maxdepth 1 -type f -perm +111 -print | sed -e 's/\.\///g' | awk '{print "\""$0"\""}' \ + # | grep -vE "\.sh|\.html"); do + # echo -ne "$i, " + # done && echo try: os.makedirs(destdir) for filename in ["velveth", "velvetg"]: From 6fba0d12d7395bff9739480346c050d02068ebbf Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:21:27 +0200 Subject: [PATCH 02/28] first pass of autopep8 --- easybuild/easyblocks/t/tornado.py | 1 + easybuild/easyblocks/t/totalview.py | 5 +++-- easybuild/easyblocks/t/trilinos.py | 31 +++++++++++++++-------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/easybuild/easyblocks/t/tornado.py b/easybuild/easyblocks/t/tornado.py index 9a9e701229..84137d77ce 100644 --- a/easybuild/easyblocks/t/tornado.py +++ b/easybuild/easyblocks/t/tornado.py @@ -30,6 +30,7 @@ import os from easybuild.easyblocks.generic.packedbinary import PackedBinary + class EB_Tornado(PackedBinary): """EasyBlock for Tornado""" diff --git a/easybuild/easyblocks/t/totalview.py b/easybuild/easyblocks/t/totalview.py index d797411f00..66726cb15a 100644 --- a/easybuild/easyblocks/t/totalview.py +++ b/easybuild/easyblocks/t/totalview.py @@ -57,7 +57,7 @@ def configure_step(self): env.setvar(self.license_env_var, self.license_file) else: - raise EasyBuildError("No viable license specifications found; specify 'license_file' or "+ + raise EasyBuildError("No viable license specifications found; specify 'license_file' or " + "define $LM_LICENSE_FILE") def install_step(self): @@ -93,5 +93,6 @@ def make_module_req_guess(self): def make_module_extra(self): """Add extra environment variables for license file and anything else.""" txt = super(EB_TotalView, self).make_module_extra() - txt += self.module_generator.prepend_paths(self.license_env_var, [self.license_file], allow_abs=True, expand_relpaths=False) + txt += self.module_generator.prepend_paths(self.license_env_var, + [self.license_file], allow_abs=True, expand_relpaths=False) return txt diff --git a/easybuild/easyblocks/t/trilinos.py b/easybuild/easyblocks/t/trilinos.py index 86d135c6a7..d28a2ebd9b 100644 --- a/easybuild/easyblocks/t/trilinos.py +++ b/easybuild/easyblocks/t/trilinos.py @@ -81,7 +81,8 @@ def configure_step(self): cxxflags = [os.getenv('CXXFLAGS')] fflags = [os.getenv('FFLAGS')] - ignore_cxx_seek_mpis = [toolchain.INTELMPI, toolchain.MPICH, toolchain.MPICH2, toolchain.MVAPICH2] #@UndefinedVariable + ignore_cxx_seek_mpis = [toolchain.INTELMPI, toolchain.MPICH, + toolchain.MPICH2, toolchain.MVAPICH2] # @UndefinedVariable ignore_cxx_seek_flag = "-DMPICH_IGNORE_CXX_SEEK" if self.toolchain.mpi_family() in ignore_cxx_seek_mpis: cflags.append(ignore_cxx_seek_flag) @@ -115,7 +116,7 @@ def configure_step(self): for dep in ["BLAS", "LAPACK"]: self.cfg.update('configopts', '-DTPL_ENABLE_%s:BOOL=ON' % dep) libdirs = os.getenv('%s_LIB_DIR' % dep) - if self.toolchain.comp_family() == toolchain.GCC: #@UndefinedVariable + if self.toolchain.comp_family() == toolchain.GCC: # @UndefinedVariable libdirs += ";%s/lib64" % get_software_root('GCC') self.cfg.update('configopts', '-D%s_LIBRARY_DIRS="%s"' % (dep, libdirs)) if self.cfg['openmp']: @@ -123,7 +124,7 @@ def configure_step(self): else: libs = os.getenv('%s_STATIC_LIBS' % dep).split(',') lib_names = ';'.join([lib_re.search(l).group(1) for l in libs]) - if self.toolchain.comp_family() == toolchain.GCC: #@UndefinedVariable + if self.toolchain.comp_family() == toolchain.GCC: # @UndefinedVariable # explicitely specify static lib! lib_names += ";libgfortran.a" self.cfg.update('configopts', '-D%s_LIBRARY_NAMES="%s"' % (dep, lib_names)) @@ -178,7 +179,7 @@ def configure_step(self): self.cfg.update('configopts', "-DTPL_ENABLE_SCALAPACK:BOOL=ON") self.cfg.update('configopts', '-DSCALAPACK_INCLUDE_DIRS:PATH="%s"' % os.getenv('SCALAPACK_INC_DIR')) self.cfg.update('configopts', '-DSCALAPACK_LIBRARY_DIRS:PATH="%s;%s"' % (os.getenv('SCALAPACK_LIB_DIR'), - os.getenv('BLACS_LIB_DIR'))) + os.getenv('BLACS_LIB_DIR'))) # PETSc petsc = get_software_root('PETSc') if petsc: @@ -186,14 +187,14 @@ def configure_step(self): incdirs = [os.path.join(petsc, "include")] self.cfg.update('configopts', '-DPETSC_INCLUDE_DIRS:PATH="%s"' % ';'.join(incdirs)) petsc_libdirs = [ - os.path.join(petsc, "lib"), - os.path.join(suitesparse, "UMFPACK", "Lib"), - os.path.join(suitesparse, "CHOLMOD", "Lib"), - os.path.join(suitesparse, "COLAMD", "Lib"), - os.path.join(suitesparse, "AMD", "Lib"), - os.getenv('FFTW_LIB_DIR'), - os.path.join(get_software_root('ParMETIS'), "Lib") - ] + os.path.join(petsc, "lib"), + os.path.join(suitesparse, "UMFPACK", "Lib"), + os.path.join(suitesparse, "CHOLMOD", "Lib"), + os.path.join(suitesparse, "COLAMD", "Lib"), + os.path.join(suitesparse, "AMD", "Lib"), + os.getenv('FFTW_LIB_DIR'), + os.path.join(get_software_root('ParMETIS'), "Lib") + ] self.cfg.update('configopts', '-DPETSC_LIBRARY_DIRS:PATH="%s"' % ';'.join(petsc_libdirs)) petsc_libnames = ["petsc", "umfpack", "cholmod", "colamd", "amd", "parmetis", "metis"] petsc_libnames += [lib_re.search(x).group(1) for x in os.getenv('FFTW_STATIC_LIBS').split(',')] @@ -207,8 +208,8 @@ def configure_step(self): deproot = get_software_root(dep) if deproot: depmap = { - 'SCOTCH': 'Scotch', - } + 'SCOTCH': 'Scotch', + } dep = depmap.get(dep, dep) self.cfg.update('configopts', "-DTPL_ENABLE_%s:BOOL=ON" % dep) incdir = os.path.join(deproot, "include") @@ -270,7 +271,7 @@ def sanity_check_step(self): libs = [l for l in libs if not l in self.cfg['skip_exts']] # Teuchos was refactored in 11.2 - if LooseVersion(self.version) >= LooseVersion('11.2') and 'Teuchos' in libs: + if LooseVersion(self.version) >= LooseVersion('11.2') and 'Teuchos' in libs: libs.remove('Teuchos') libs.extend(['teuchoscomm', 'teuchoscore', 'teuchosnumerics', 'teuchosparameterlist', 'teuchosremainder']) From 5c7ebe0f40b68a9559bdf276a52652ed6097a117 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:46:30 +0200 Subject: [PATCH 03/28] fix flake8 for t --- easybuild/easyblocks/t/tau.py | 6 +++--- easybuild/easyblocks/t/totalview.py | 1 - easybuild/easyblocks/t/trilinos.py | 6 +++--- easybuild/easyblocks/t/trinity.py | 2 -- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/easybuild/easyblocks/t/tau.py b/easybuild/easyblocks/t/tau.py index 83d538fbc9..df382a0a7f 100644 --- a/easybuild/easyblocks/t/tau.py +++ b/easybuild/easyblocks/t/tau.py @@ -196,7 +196,7 @@ def configure_step(self): raise EasyBuildError("Failed to determine MPI include/library paths, no MPI available in toolchain?") # make sure selected default TAU makefile will be available - avail_makefiles = ['Makefile.' + l for l in self.variant_labels] + avail_makefiles = ['Makefile.' + x for x in self.variant_labels] if self.cfg['tau_makefile'] not in avail_makefiles: raise EasyBuildError("Specified tau_makefile %s will not be available (only: %s)", self.cfg['tau_makefile'], avail_makefiles) @@ -251,8 +251,8 @@ def sanity_check_step(self): 'files': [os.path.join('bin', 'pprof'), os.path.join('include', 'TAU.h'), os.path.join('lib', 'libTAU.%s' % get_shared_lib_ext())] + - [os.path.join('lib', 'lib%s.a' % l) for l in self.variant_labels] + - [os.path.join('lib', 'Makefile.' + l) for l in self.variant_labels], + [os.path.join('lib', 'lib%s.a' % x) for x in self.variant_labels] + + [os.path.join('lib', 'Makefile.' + x) for x in self.variant_labels], 'dirs': [], } super(EB_TAU, self).sanity_check_step(custom_paths=custom_paths) diff --git a/easybuild/easyblocks/t/totalview.py b/easybuild/easyblocks/t/totalview.py index 66726cb15a..c82b248eee 100644 --- a/easybuild/easyblocks/t/totalview.py +++ b/easybuild/easyblocks/t/totalview.py @@ -23,7 +23,6 @@ from easybuild.framework.easyconfig.types import ensure_iterable_license_specs from easybuild.tools.build_log import EasyBuildError from easybuild.tools.filetools import find_flexlm_license -from easybuild.tools.modules import get_software_root from easybuild.tools.run import run_cmd diff --git a/easybuild/easyblocks/t/trilinos.py b/easybuild/easyblocks/t/trilinos.py index d28a2ebd9b..406ed69551 100644 --- a/easybuild/easyblocks/t/trilinos.py +++ b/easybuild/easyblocks/t/trilinos.py @@ -123,7 +123,7 @@ def configure_step(self): libs = os.getenv('%s_MT_STATIC_LIBS' % dep).split(',') else: libs = os.getenv('%s_STATIC_LIBS' % dep).split(',') - lib_names = ';'.join([lib_re.search(l).group(1) for l in libs]) + lib_names = ';'.join([lib_re.search(x).group(1) for x in libs]) if self.toolchain.comp_family() == toolchain.GCC: # @UndefinedVariable # explicitely specify static lib! lib_names += ";libgfortran.a" @@ -268,7 +268,7 @@ def sanity_check_step(self): "Pamgen", "RTOp", "Rythmos", "Sacado", "Shards", "Stratimikos", "Teuchos", "Tpetra", "Triutils", "Zoltan"] - libs = [l for l in libs if not l in self.cfg['skip_exts']] + libs = [x for x in libs if x not in self.cfg['skip_exts']] # Teuchos was refactored in 11.2 if LooseVersion(self.version) >= LooseVersion('11.2') and 'Teuchos' in libs: @@ -292,7 +292,7 @@ def sanity_check_step(self): lib_ext = 'a' custom_paths = { - 'files': [os.path.join('lib', 'lib%s.%s' % (l.lower(), lib_ext)) for l in libs], + 'files': [os.path.join('lib', 'lib%s.%s' % (x.lower(), lib_ext)) for x in libs], 'dirs': ['bin', 'include'] } diff --git a/easybuild/easyblocks/t/trinity.py b/easybuild/easyblocks/t/trinity.py index 4c84080482..76200ad3a3 100644 --- a/easybuild/easyblocks/t/trinity.py +++ b/easybuild/easyblocks/t/trinity.py @@ -35,9 +35,7 @@ """ import glob import os -import re import shutil -import sys from distutils.version import LooseVersion import easybuild.tools.toolchain as toolchain From 7fdcb023a5dd790c50cf420a6b737784974ef2ca Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:49:05 +0200 Subject: [PATCH 04/28] first pass of autopep8 --- easybuild/easyblocks/s/scalapack.py | 12 ++++++------ easybuild/easyblocks/s/siesta.py | 2 +- easybuild/easyblocks/s/soapdenovo.py | 8 ++++---- easybuild/easyblocks/s/stata.py | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/easybuild/easyblocks/s/scalapack.py b/easybuild/easyblocks/s/scalapack.py index d7a0c0e5d7..41ab2952c2 100644 --- a/easybuild/easyblocks/s/scalapack.py +++ b/easybuild/easyblocks/s/scalapack.py @@ -37,7 +37,7 @@ from distutils.version import LooseVersion import easybuild.tools.toolchain as toolchain -from easybuild.easyblocks.blacs import det_interface #@UnresolvedImport +from easybuild.easyblocks.blacs import det_interface # @UnresolvedImport from easybuild.easyblocks.generic.configuremake import ConfigureMake from easybuild.toolchains.linalg.acml import Acml from easybuild.toolchains.linalg.atlas import Atlas @@ -75,9 +75,9 @@ def build_step(self): """Build ScaLAPACK using make after setting make options.""" # MPI compiler commands - known_mpi_libs = [toolchain.MPICH, toolchain.MPICH2, toolchain.MVAPICH2] #@UndefinedVariable - known_mpi_libs += [toolchain.OPENMPI, toolchain.QLOGICMPI] #@UndefinedVariable - known_mpi_libs += [toolchain.INTELMPI] #@UndefinedVariable + known_mpi_libs = [toolchain.MPICH, toolchain.MPICH2, toolchain.MVAPICH2] # @UndefinedVariable + known_mpi_libs += [toolchain.OPENMPI, toolchain.QLOGICMPI] # @UndefinedVariable + known_mpi_libs += [toolchain.INTELMPI] # @UndefinedVariable if os.getenv('MPICC') and os.getenv('MPIF77') and os.getenv('MPIF90'): mpicc = os.getenv('MPICC') mpif77 = os.getenv('MPIF77') @@ -223,8 +223,8 @@ def install_step(self): # include files and libraries path_info = [ - ('SRC', 'include', '.h'), # include files - ('', 'lib', '.a'), # libraries + ('SRC', 'include', '.h'), # include files + ('', 'lib', '.a'), # libraries ] for (srcdir, destdir, ext) in path_info: diff --git a/easybuild/easyblocks/s/siesta.py b/easybuild/easyblocks/s/siesta.py index 3a59b7aa2c..d235f9072e 100644 --- a/easybuild/easyblocks/s/siesta.py +++ b/easybuild/easyblocks/s/siesta.py @@ -343,7 +343,7 @@ def configure_step(self): 'SiestaSubroutine/SimpleTest/Src/simple_pipes_serial', 'SiestaSubroutine/SimpleTest/Src/simple_sockets_parallel', 'SiestaSubroutine/SimpleTest/Src/simple_sockets_serial', - ]) + ]) expected_utils.extend([ 'Sockets/f2fmaster', 'Sockets/f2fslave', ]) diff --git a/easybuild/easyblocks/s/soapdenovo.py b/easybuild/easyblocks/s/soapdenovo.py index 268ac25e7a..9f7984643b 100644 --- a/easybuild/easyblocks/s/soapdenovo.py +++ b/easybuild/easyblocks/s/soapdenovo.py @@ -36,7 +36,7 @@ def __init__(self, *args, **kwargs): def configure_step(self): """ - Skip the configure as not part of this build process + Skip the configure as not part of this build process """ pass @@ -59,8 +59,8 @@ def sanity_check_step(self): """Custom sanity check for SOAPdenovo.""" custom_paths = { - 'files': ['bin/SOAPdenovo-%s' % x for x in self.bin_suffixes], - 'dirs': [] - } + 'files': ['bin/SOAPdenovo-%s' % x for x in self.bin_suffixes], + 'dirs': [] + } super(EB_SOAPdenovo, self).sanity_check_step(custom_paths=custom_paths) diff --git a/easybuild/easyblocks/s/stata.py b/easybuild/easyblocks/s/stata.py index 8c1c13cfc7..02d9b62aab 100644 --- a/easybuild/easyblocks/s/stata.py +++ b/easybuild/easyblocks/s/stata.py @@ -41,7 +41,7 @@ class EB_Stata(PackedBinary): def install_step(self): """Custom install procedure for Stata.""" - + change_dir(self.installdir) cmd = os.path.join(self.cfg['start_dir'], 'install') From 77b31e18d3f85421bfe73fea9f1faa33a06966f0 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:49:27 +0200 Subject: [PATCH 05/28] second pass of autopep8 --- easybuild/easyblocks/s/samtools.py | 2 +- easybuild/easyblocks/s/sas.py | 24 ++++++++++++------------ easybuild/easyblocks/s/scotch.py | 4 ++-- easybuild/easyblocks/s/stata.py | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/easybuild/easyblocks/s/samtools.py b/easybuild/easyblocks/s/samtools.py index 9cf4e4dfa3..33547b0553 100644 --- a/easybuild/easyblocks/s/samtools.py +++ b/easybuild/easyblocks/s/samtools.py @@ -59,7 +59,7 @@ def __init__(self, *args, **kwargs): if LooseVersion(self.version) < LooseVersion('1.0'): self.bin_files += ["bcftools/vcfutils.pl", "bcftools/bcftools"] - self.include_files += ["bgzf.h", "faidx.h", "khash.h", "klist.h", "knetfile.h", "razf.h", + self.include_files += ["bgzf.h", "faidx.h", "khash.h", "klist.h", "knetfile.h", "razf.h", "kseq.h", "ksort.h", "kstring.h"] elif LooseVersion(self.version) >= LooseVersion('1.0'): self.bin_files += ["misc/plot-bamstats", "misc/seq_cache_populate.pl"] diff --git a/easybuild/easyblocks/s/sas.py b/easybuild/easyblocks/s/sas.py index a14f000432..7222252024 100644 --- a/easybuild/easyblocks/s/sas.py +++ b/easybuild/easyblocks/s/sas.py @@ -76,20 +76,20 @@ def install_step(self): "Sample Library:": os.path.join(self.installdir, 'cstSampleLibrary'), } std_qa = { - "Incomplete Deployment\s*(.*[^:])+Selection:": '2', # 2: Ignore previous deployment and start again - "Select a language(.*[^:]\s*\n)+Selection:": '', - "Select Deployment Task\s*(.*[^:]\s*\n)+Selection:": '', - "Specify SAS Home\s*(.*[^:]\s*\n)+Selection:": '2', # Create a new SAS Home - "Select Deployment Type\s*(.*[^:]\n)+Selection:": '2', # 2: Install SAS Foundation - "Select Products to Install\s*(.*[^:]\n)+Selection:": '1', # SAS Foundation - "Product\s*(.*[^:]\n)+Selections:": '', - "Select Language Support\s*(.*[^:]\n)+Selections:": '', - "Select Regional Settings\s*(.*[^:]\n)+Selection:": '', - "Select Support Option\s*(.*[^:]\n)+Selection:": '2', # 2: Do Not Send - "Select SAS Foundation Products(.*[^:]\s*\n)+Selection:": '', + r"Incomplete Deployment\s*(.*[^:])+Selection:": '2', # 2: Ignore previous deployment and start again + r"Select a language(.*[^:]\s*\n)+Selection:": '', + r"Select Deployment Task\s*(.*[^:]\s*\n)+Selection:": '', + r"Specify SAS Home\s*(.*[^:]\s*\n)+Selection:": '2', # Create a new SAS Home + r"Select Deployment Type\s*(.*[^:]\n)+Selection:": '2', # 2: Install SAS Foundation + r"Select Products to Install\s*(.*[^:]\n)+Selection:": '1', # SAS Foundation + r"Product\s*(.*[^:]\n)+Selections:": '', + r"Select Language Support\s*(.*[^:]\n)+Selections:": '', + r"Select Regional Settings\s*(.*[^:]\n)+Selection:": '', + r"Select Support Option\s*(.*[^:]\n)+Selection:": '2', # 2: Do Not Send + r"Select SAS Foundation Products(.*[^:]\s*\n)+Selection:": '', } no_qa = [ - "\.\.\.$", + r"\.\.\.$", ] run_cmd_qa("./setup.sh -console", qa, no_qa=no_qa, std_qa=std_qa, log_all=True, simple=True) diff --git a/easybuild/easyblocks/s/scotch.py b/easybuild/easyblocks/s/scotch.py index dec34d255b..354df76747 100644 --- a/easybuild/easyblocks/s/scotch.py +++ b/easybuild/easyblocks/s/scotch.py @@ -80,9 +80,9 @@ def configure_step(self): (r"^CCP\s*=.*$", "CCP\t= $(MPICC)"), (r"^CCD\s*=.*$", "CCD\t= $(MPICC)"), # append -lpthread to LDFLAGS - (r"^LDFLAGS\s*=(?P.*$)", "LDFLAGS\t=\g -lpthread"), + (r"^LDFLAGS\s*=(?P.*$)", r"LDFLAGS\t=\g -lpthread"), # prepend -L${EBROOTZLIB}/lib to LDFLAGS - (r"^LDFLAGS\s*=(?P.*$)", "LDFLAGS\t=-L${EBROOTZLIB}/lib \g"), + (r"^LDFLAGS\s*=(?P.*$)", r"LDFLAGS\t=-L${EBROOTZLIB}/lib \g"), ] apply_regex_substitutions(makefile_inc, regex_subs) diff --git a/easybuild/easyblocks/s/stata.py b/easybuild/easyblocks/s/stata.py index 02d9b62aab..f522d9500d 100644 --- a/easybuild/easyblocks/s/stata.py +++ b/easybuild/easyblocks/s/stata.py @@ -46,9 +46,9 @@ def install_step(self): cmd = os.path.join(self.cfg['start_dir'], 'install') std_qa = { - "Do you wish to continue\?\s*\(y/n or q to quit\)": 'y', - "Are you sure you want to install into .*\?\s*\(y/n or q\)": 'y', - "Okay to proceed\s*\(y/n or q to quit\)": 'y', + r"Do you wish to continue\?\s*\(y/n or q to quit\)": 'y', + r"Are you sure you want to install into .*\?\s*\(y/n or q\)": 'y', + r"Okay to proceed\s*\(y/n or q to quit\)": 'y', } no_qa = [ "About to proceed with installation:", From 498ae656bad4f1c40ceba5ab2f29162dbd85a8ef Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:50:56 +0200 Subject: [PATCH 06/28] fix flake8 for s --- easybuild/easyblocks/s/scotch.py | 6 +++--- easybuild/easyblocks/s/snphylo.py | 1 - easybuild/easyblocks/s/stata.py | 3 ++- easybuild/easyblocks/s/suitesparse.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/easybuild/easyblocks/s/scotch.py b/easybuild/easyblocks/s/scotch.py index 354df76747..d45e47dd31 100644 --- a/easybuild/easyblocks/s/scotch.py +++ b/easybuild/easyblocks/s/scotch.py @@ -156,14 +156,14 @@ def sanity_check_step(self): 'dggath', 'dgmap', 'dgord', 'dgpart', 'dgscat', 'dgtst', 'gbase', 'gcv', 'gmap', 'gmk_hy', 'gmk_m2', 'gmk_m3', 'gmk_msh', 'gmk_ub2', 'gmtst', 'gord', 'gotst', 'gout', 'gpart', 'gscat', 'gtst', 'mcv', 'mmk_m2', 'mmk_m3', 'mord', 'mtst'] - custom_paths['files'].extend([os.path.join('bin', b) for b in binaries]) + custom_paths['files'].extend([os.path.join('bin', x) for x in binaries]) headers = ['esmumps', 'ptscotch', 'ptscotchf', 'scotch', 'scotchf'] - custom_paths['files'].extend([os.path.join('include', '%s.h' % h) for h in headers]) + custom_paths['files'].extend([os.path.join('include', '%s.h' % x) for x in headers]) libraries = ['esmumps', 'ptesmumps', 'ptscotch', 'ptscotcherr', 'ptscotcherrexit', 'scotch', 'scotch_group', 'scotcherr', 'scotcherrexit'] - custom_paths['files'].extend([os.path.join('lib', 'lib%s.a' % l) for l in libraries]) + custom_paths['files'].extend([os.path.join('lib', 'lib%s.a' % x) for x in libraries]) custom_commands = [] diff --git a/easybuild/easyblocks/s/snphylo.py b/easybuild/easyblocks/s/snphylo.py index 9b4cce1e78..4039951175 100644 --- a/easybuild/easyblocks/s/snphylo.py +++ b/easybuild/easyblocks/s/snphylo.py @@ -30,7 +30,6 @@ """ import os import re -import shutil import stat from distutils.version import LooseVersion diff --git a/easybuild/easyblocks/s/stata.py b/easybuild/easyblocks/s/stata.py index f522d9500d..a49270bb5a 100644 --- a/easybuild/easyblocks/s/stata.py +++ b/easybuild/easyblocks/s/stata.py @@ -58,7 +58,8 @@ def install_step(self): ] run_cmd_qa(cmd, {}, no_qa=no_qa, std_qa=std_qa, log_all=True, simple=True) - print_msg("Note: you need to manually run ./stinit in %s to initialise the license for Stata!" % self.installdir) + print_msg("Note: you need to manually run ./stinit in %s to initialise the license for Stata!" + % self.installdir) def sanity_check_step(self): """Custom sanity check for Stata.""" diff --git a/easybuild/easyblocks/s/suitesparse.py b/easybuild/easyblocks/s/suitesparse.py index 5afbd39dc1..f129df0d7e 100644 --- a/easybuild/easyblocks/s/suitesparse.py +++ b/easybuild/easyblocks/s/suitesparse.py @@ -216,7 +216,7 @@ def sanity_check_step(self): # Latest version of SuiteSparse also compiles shared library and put them in 'lib' shlib_ext = get_shared_lib_ext() if LooseVersion(self.version) >= LooseVersion('4.5.1'): - libs += [os.path.join('lib', 'lib%s.%s' % (l.lower(), shlib_ext)) for l in libnames] + libs += [os.path.join('lib', 'lib%s.%s' % (x.lower(), shlib_ext)) for x in libnames] custom_paths = { 'files': libs, From 7cdb68fd84193396d23d7dd96b8bf2348ff9854f Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:51:19 +0200 Subject: [PATCH 07/28] first pass of autopep8 --- easybuild/easyblocks/r/r.py | 2 +- easybuild/easyblocks/r/rmpi.py | 6 +++--- easybuild/easyblocks/r/rosetta.py | 8 ++++---- easybuild/easyblocks/r/ruby.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/easybuild/easyblocks/r/r.py b/easybuild/easyblocks/r/r.py index 93d632c285..0fc9a520ff 100644 --- a/easybuild/easyblocks/r/r.py +++ b/easybuild/easyblocks/r/r.py @@ -135,7 +135,7 @@ def sanity_check_step(self): custom_paths = { 'files': ['bin/%s' % x for x in ['R', 'Rscript']] + - [(os.path.join('lib64', 'R', f), os.path.join('lib', 'R', f)) for f in libfiles], + [(os.path.join('lib64', 'R', f), os.path.join('lib', 'R', f)) for f in libfiles], 'dirs': [], } super(EB_R, self).sanity_check_step(custom_paths=custom_paths) diff --git a/easybuild/easyblocks/r/rmpi.py b/easybuild/easyblocks/r/rmpi.py index b5d3754aa3..87efc71014 100644 --- a/easybuild/easyblocks/r/rmpi.py +++ b/easybuild/easyblocks/r/rmpi.py @@ -46,15 +46,15 @@ def run(self): mpi_types = { toolchain.MPI_TYPE_OPENMPI: "OPENMPI", toolchain.MPI_TYPE_MPICH: "MPICH", - #toolchain.MPI_TYPE_LAM: "LAM", # no support for LAM yet + # toolchain.MPI_TYPE_LAM: "LAM", # no support for LAM yet } # type of MPI # MPI_TYPE does not distinguish between MPICH and IntelMPI, which is why we also check mpi_family() mpi_type = self.toolchain.mpi_family() Rmpi_type = mpi_types[self.toolchain.MPI_TYPE] - # Rmpi versions 0.6-4 and up support INTELMPI (using --with-Rmpi-type=INTELMPI) + # Rmpi versions 0.6-4 and up support INTELMPI (using --with-Rmpi-type=INTELMPI) if ((LooseVersion(self.version) >= LooseVersion('0.6-4')) and (mpi_type == toolchain.INTELMPI)): - Rmpi_type = 'INTELMPI' + Rmpi_type = 'INTELMPI' self.log.debug("Setting configure args for Rmpi") self.configureargs = [ diff --git a/easybuild/easyblocks/r/rosetta.py b/easybuild/easyblocks/r/rosetta.py index 0e22c06d51..598efce0e2 100644 --- a/easybuild/easyblocks/r/rosetta.py +++ b/easybuild/easyblocks/r/rosetta.py @@ -100,9 +100,9 @@ def configure_step(self): self.detect_cxx() cxx_ver = None - if self.toolchain.comp_family() in [toolchain.GCC]: #@UndefinedVariable + if self.toolchain.comp_family() in [toolchain.GCC]: # @UndefinedVariable cxx_ver = '.'.join(get_software_version('GCC').split('.')[:2]) - elif self.toolchain.comp_family() in [toolchain.INTELCOMP]: #@UndefinedVariable + elif self.toolchain.comp_family() in [toolchain.INTELCOMP]: # @UndefinedVariable cxx_ver = '.'.join(get_icc_version().split('.')[:2]) else: raise EasyBuildError("Don't know how to determine C++ compiler version.") @@ -278,7 +278,7 @@ def sanity_check_step(self): binaries = ["AbinitioRelax", "backrub", "cluster", "combine_silent", "extract_pdbs", "idealize_jd2", "packstat", "relax", "score_jd2", "score"] custom_paths = { - 'files':["bin/%s.%slinux%srelease" % (x, infix, self.cxx) for x in binaries], - 'dirs':[], + 'files': ["bin/%s.%slinux%srelease" % (x, infix, self.cxx) for x in binaries], + 'dirs': [], } super(EB_Rosetta, self).sanity_check_step(custom_paths=custom_paths) diff --git a/easybuild/easyblocks/r/ruby.py b/easybuild/easyblocks/r/ruby.py index 995830518a..b2edcb8d92 100644 --- a/easybuild/easyblocks/r/ruby.py +++ b/easybuild/easyblocks/r/ruby.py @@ -38,7 +38,7 @@ class EB_Ruby(ConfigureMake): """Building and installing Ruby including support for gems""" - + def prepare_for_extensions(self): """Sets default class and filter for gems""" self.cfg['exts_defaultclass'] = 'RubyGem' From 8eff3b82bab62882aa6779b2bc6ff81f43de2c00 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:51:31 +0200 Subject: [PATCH 08/28] second pass of autopep8 --- easybuild/easyblocks/r/r.py | 2 +- easybuild/easyblocks/r/rosetta.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/easybuild/easyblocks/r/r.py b/easybuild/easyblocks/r/r.py index 0fc9a520ff..bfae7eebea 100644 --- a/easybuild/easyblocks/r/r.py +++ b/easybuild/easyblocks/r/r.py @@ -91,7 +91,7 @@ def configure_step(self): out = ConfigureMake.configure_step(self) # check output of configure command to verify BLAS/LAPACK settings - ext_libs_regex = re.compile("External libraries:.*BLAS\((?P.*)\).*LAPACK\((?P.*)\)") + ext_libs_regex = re.compile(r"External libraries:.*BLAS\((?P.*)\).*LAPACK\((?P.*)\)") res = ext_libs_regex.search(out) if res: for lib in ['BLAS', 'LAPACK']: diff --git a/easybuild/easyblocks/r/rosetta.py b/easybuild/easyblocks/r/rosetta.py index 598efce0e2..c232ef9257 100644 --- a/easybuild/easyblocks/r/rosetta.py +++ b/easybuild/easyblocks/r/rosetta.py @@ -166,7 +166,7 @@ def configure_step(self): # make sure specified compiler version is accepted by patching it in os_fp = os.path.join(self.srcdir, "tools/build/options.settings") - cxxver_re = re.compile('(.*"%s".*)(,\s*"\*"\s*],.*)' % self.cxx, re.M) + cxxver_re = re.compile(r'(.*"%s".*)(,\s*"\*"\s*],.*)' % self.cxx, re.M) for line in fileinput.input(os_fp, inplace=1, backup='.orig.eb'): line = cxxver_re.sub(r'\1, "%s"\2' % cxx_ver, line) sys.stdout.write(line) @@ -208,7 +208,7 @@ def install_step(self): except OSError as err: raise EasyBuildError("Failed to walk build/src dir: %s", err) # copy binaries/libraries to install dir - lib_re = re.compile("^lib.*\.%s$" % shlib_ext) + lib_re = re.compile(r"^lib.*\.%s$" % shlib_ext) try: for fil in os.listdir(builddir): srcfile = os.path.join(builddir, fil) From 8a98113f46736a268c930791132dad683f16d6cf Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:52:20 +0200 Subject: [PATCH 09/28] fix flake8 for r --- easybuild/easyblocks/r/__init__.py | 30 ------------------------------ easybuild/easyblocks/r/rosetta.py | 2 +- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/easybuild/easyblocks/r/__init__.py b/easybuild/easyblocks/r/__init__.py index 73567e3646..e69de29bb2 100644 --- a/easybuild/easyblocks/r/__init__.py +++ b/easybuild/easyblocks/r/__init__.py @@ -1,30 +0,0 @@ -## -# Copyright 2009-2020 Ghent University -# -# This file is part of EasyBuild, -# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), -# with support of Ghent University (http://ugent.be/hpc), -# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), -# Flemish Research Foundation (FWO) (http://www.fwo.be/en) -# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). -# -# https://github.com/easybuilders/easybuild -# -# EasyBuild is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation v2. -# -# EasyBuild is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with EasyBuild. If not, see . -## -""" -Special handling of R easyblocks, due to clash with easybuild.easyblocks.r namespace. - -author: Kenneth Hoste (Ghent University) -""" -from easybuild.easyblocks.r.r import * diff --git a/easybuild/easyblocks/r/rosetta.py b/easybuild/easyblocks/r/rosetta.py index c232ef9257..436ee4ac91 100644 --- a/easybuild/easyblocks/r/rosetta.py +++ b/easybuild/easyblocks/r/rosetta.py @@ -137,7 +137,7 @@ def configure_step(self): " 'program_path': %s," % str(paths), " 'flags': {", " 'compile': %s," % str(flags), - #" 'mode': %s," % str(o_flags), + # " 'mode': %s," % str(o_flags), " },", " 'defines': %s," % str(defines), " },", From 4279398257b626bacb340e0297b55bbc02acfcfb Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:54:03 +0200 Subject: [PATCH 10/28] first pass of autopep8 --- easybuild/easyblocks/q/qscintilla.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/q/qscintilla.py b/easybuild/easyblocks/q/qscintilla.py index d2d28e5efd..84ff567de1 100644 --- a/easybuild/easyblocks/q/qscintilla.py +++ b/easybuild/easyblocks/q/qscintilla.py @@ -117,7 +117,7 @@ def install_step(self): # in case PyQt5's sip was installed in directories that are specific to each version of python # as could happen with multi_deps pyqt_sipdir = find_glob_pattern(os.path.join(self.pyqt_root, 'share', 'python%s*' % pyshortver, - 'site-packages', 'sip', self.pyqt_pkg_name), False) + 'site-packages', 'sip', self.pyqt_pkg_name), False) # fall back to a single sipdir if not pyqt_sipdir: pyqt_sipdir = os.path.join(self.pyqt_root, 'share', 'sip', self.pyqt_pkg_name) From a0d79f09dfb92458505e0d98126fb47f8f568081 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:54:14 +0200 Subject: [PATCH 11/28] second pass of autopep8 --- easybuild/easyblocks/q/qscintilla.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/q/qscintilla.py b/easybuild/easyblocks/q/qscintilla.py index 84ff567de1..c735a800f0 100644 --- a/easybuild/easyblocks/q/qscintilla.py +++ b/easybuild/easyblocks/q/qscintilla.py @@ -88,7 +88,7 @@ def build_step(self): """Custom build procedure for QScintilla.""" # make sure that $CXXFLAGS is being passed down - self.cfg.update('buildopts', 'CXXFLAGS="$CXXFLAGS \$(DEFINES)"') + self.cfg.update('buildopts', r'CXXFLAGS="$CXXFLAGS \$(DEFINES)"') super(EB_QScintilla, self).build_step() From 2b8f664a00b1369c48ec2803ce0bb60129eb8a13 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:54:38 +0200 Subject: [PATCH 12/28] fix flake8 for q --- easybuild/easyblocks/q/qt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/q/qt.py b/easybuild/easyblocks/q/qt.py index 3e9649fafb..76f99b584e 100644 --- a/easybuild/easyblocks/q/qt.py +++ b/easybuild/easyblocks/q/qt.py @@ -175,7 +175,7 @@ def sanity_check_step(self): elif myarch == POWER: self.log.debug("Skipping check for qtwebengine, since it is not supported on POWER.") else: - qtwebengine_libs = ['libQt%s%s.%s' % (libversion, l, shlib_ext) for l in ['WebEngine', 'WebEngineCore']] + qtwebengine_libs = ['libQt%s%s.%s' % (libversion, x, shlib_ext) for x in ['WebEngine', 'WebEngineCore']] custom_paths['files'].extend([os.path.join('lib', lib) for lib in qtwebengine_libs]) if LooseVersion(self.version) >= LooseVersion('4'): From 21bc43c69a90be02c32640e14b3b72f7cd725555 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:55:16 +0200 Subject: [PATCH 13/28] first pass of autopep8 --- easybuild/easyblocks/p/parmetis.py | 2 +- easybuild/easyblocks/p/pasha.py | 9 +++++---- easybuild/easyblocks/p/pbdmpi.py | 1 + easybuild/easyblocks/p/pbdslap.py | 1 + easybuild/easyblocks/p/petsc.py | 6 +++--- easybuild/easyblocks/p/pgi.py | 2 +- easybuild/easyblocks/p/primer3.py | 12 ++++++------ easybuild/easyblocks/p/psmpi.py | 2 +- easybuild/easyblocks/p/pyquante.py | 1 - easybuild/easyblocks/p/pyzmq.py | 3 +-- 10 files changed, 20 insertions(+), 19 deletions(-) diff --git a/easybuild/easyblocks/p/parmetis.py b/easybuild/easyblocks/p/parmetis.py index 9e5755ba22..6f4a965596 100644 --- a/easybuild/easyblocks/p/parmetis.py +++ b/easybuild/easyblocks/p/parmetis.py @@ -148,7 +148,7 @@ def install_step(self): # libraries try: - src = os.path.join(self.cfg['start_dir'], 'build' ,'libmetis' ,'libmetis.a') + src = os.path.join(self.cfg['start_dir'], 'build', 'libmetis', 'libmetis.a') dst = os.path.join(libdir, 'libmetis.a') shutil.copy2(src, dst) except OSError as err: diff --git a/easybuild/easyblocks/p/pasha.py b/easybuild/easyblocks/p/pasha.py index 8d8044b95e..9eada395f1 100644 --- a/easybuild/easyblocks/p/pasha.py +++ b/easybuild/easyblocks/p/pasha.py @@ -47,7 +47,8 @@ def configure_step(self): raise EasyBuildError("TBB module not loaded.") self.cfg.update('buildopts', "TBB_DIR=%s/tbb MPI_DIR='' MPI_INC='' " % tbb) - self.cfg.update('buildopts', 'MPI_CXX="%s" OPM_FLAG="%s"' % (os.getenv('MPICXX'), self.toolchain.get_flag('openmp'))) + self.cfg.update('buildopts', 'MPI_CXX="%s" OPM_FLAG="%s"' % + (os.getenv('MPICXX'), self.toolchain.get_flag('openmp'))) self.cfg.update('buildopts', 'MPI_LIB="" MY_CXX="%s" MPICH_IGNORE_CXX_SEEK=1' % os.getenv('CXX')) def install_step(self): @@ -60,8 +61,8 @@ def sanity_check_step(self): """Custom sanity check for Pasha""" custom_paths = { - 'files':["bin/pasha-%s" % x for x in ["kmergen", "pregraph", "graph"]], - 'dirs':[], - } + 'files': ["bin/pasha-%s" % x for x in ["kmergen", "pregraph", "graph"]], + 'dirs': [], + } super(EB_Pasha, self).sanity_check_step(custom_paths=custom_paths) diff --git a/easybuild/easyblocks/p/pbdmpi.py b/easybuild/easyblocks/p/pbdmpi.py index 3a15873dac..431452b4ea 100644 --- a/easybuild/easyblocks/p/pbdmpi.py +++ b/easybuild/easyblocks/p/pbdmpi.py @@ -32,6 +32,7 @@ import easybuild.tools.toolchain as toolchain from easybuild.easyblocks.generic.rpackage import RPackage + class EB_pbdMPI(RPackage): """Support for building/installing pbdMPI.""" diff --git a/easybuild/easyblocks/p/pbdslap.py b/easybuild/easyblocks/p/pbdslap.py index d15db0a8fc..ea2e797f33 100644 --- a/easybuild/easyblocks/p/pbdslap.py +++ b/easybuild/easyblocks/p/pbdslap.py @@ -30,6 +30,7 @@ from easybuild.easyblocks.generic.rpackage import RPackage + class EB_pbdSLAP(RPackage): """Support for building/installing pbdSLAP.""" diff --git a/easybuild/easyblocks/p/petsc.py b/easybuild/easyblocks/p/petsc.py index 023486b9ca..3ce02456e6 100644 --- a/easybuild/easyblocks/p/petsc.py +++ b/easybuild/easyblocks/p/petsc.py @@ -126,7 +126,7 @@ def configure_step(self): self.cfg.update('configopts', '--with-cxxflags="%s"' % cxxflags) self.cfg.update('configopts', '--with-fcflags="%s"' % os.getenv('F90FLAGS')) - if not self.toolchain.comp_family() == toolchain.GCC: #@UndefinedVariable + if not self.toolchain.comp_family() == toolchain.GCC: # @UndefinedVariable self.cfg.update('configopts', '--with-gnu-compilers=0') # MPI @@ -212,12 +212,12 @@ def configure_step(self): ss_libs = ["UMFPACK", "KLU", "CHOLMOD", "BTF", "CCOLAMD", "COLAMD", "CAMD", "AMD"] suitesparse_inc = [os.path.join(suitesparse, l, "Include") - for l in ss_libs] + for l in ss_libs] suitesparse_inc.append(os.path.join(suitesparse, "SuiteSparse_config")) inc_spec = "-include=[%s]" % ','.join(suitesparse_inc) suitesparse_libs = [os.path.join(suitesparse, l, "Lib", "lib%s.a" % l.lower()) - for l in ss_libs] + for l in ss_libs] suitesparse_libs.append(os.path.join(suitesparse, "SuiteSparse_config", "libsuitesparseconfig.a")) lib_spec = "-lib=[%s]" % ','.join(suitesparse_libs) else: diff --git a/easybuild/easyblocks/p/pgi.py b/easybuild/easyblocks/p/pgi.py index d420a6f861..cbd660cf86 100644 --- a/easybuild/easyblocks/p/pgi.py +++ b/easybuild/easyblocks/p/pgi.py @@ -133,7 +133,7 @@ def install_step(self): 'PGI_INSTALL_MANAGED': str(self.cfg['install_managed']).lower(), 'PGI_INSTALL_NVIDIA': str(self.cfg['install_nvidia']).lower(), 'PGI_SILENT': 'true', - } + } cmd = "%s ./install" % ' '.join(['%s=%s' % x for x in sorted(pgi_env_vars.items())]) run_cmd(cmd, log_all=True, simple=True) diff --git a/easybuild/easyblocks/p/primer3.py b/easybuild/easyblocks/p/primer3.py index 14012aca8e..09497a1be7 100644 --- a/easybuild/easyblocks/p/primer3.py +++ b/easybuild/easyblocks/p/primer3.py @@ -61,8 +61,8 @@ def guess_start_dir(self): def configure_step(self): """Configure Primer3 build by setting make options.""" self.cfg.update('buildopts', 'CC="%s" CPP="%s" O_OPTS="%s" all' % (os.getenv('CC'), - os.getenv('CXX'), - os.getenv('CFLAGS'))) + os.getenv('CXX'), + os.getenv('CFLAGS'))) # default build_step should be fine @@ -74,10 +74,10 @@ def sanity_check_step(self): """Custom sanity check for Primer3.""" custom_paths = { - 'files':["%s/%s" % (self.bindir, x) for x in ["primer3_core", "ntdpal", - "oligotm", "long_seq_tm_test"]], - 'dirs':[] - } + 'files': ["%s/%s" % (self.bindir, x) for x in ["primer3_core", "ntdpal", + "oligotm", "long_seq_tm_test"]], + 'dirs': [] + } super(EB_Primer3, self).sanity_check_step(custom_paths=custom_paths) diff --git a/easybuild/easyblocks/p/psmpi.py b/easybuild/easyblocks/p/psmpi.py index bf7e0b7e1d..5b02ace362 100644 --- a/easybuild/easyblocks/p/psmpi.py +++ b/easybuild/easyblocks/p/psmpi.py @@ -73,7 +73,7 @@ def configure_step(self): toolchain.GCC: 'gcc', toolchain.INTELCOMP: 'intel', # TODO: Include PGI as soon as it is available as toolchain - #toolchain.PGI: 'pgi', + # toolchain.PGI: 'pgi', } # Set confset diff --git a/easybuild/easyblocks/p/pyquante.py b/easybuild/easyblocks/p/pyquante.py index 5491578ddf..2b2bddc990 100644 --- a/easybuild/easyblocks/p/pyquante.py +++ b/easybuild/easyblocks/p/pyquante.py @@ -46,4 +46,3 @@ def configure_step(self): self.log.warn("Not building Libint extension") super(EB_PyQuante, self).configure_step() - diff --git a/easybuild/easyblocks/p/pyzmq.py b/easybuild/easyblocks/p/pyzmq.py index b302b791a7..d238bdd33e 100644 --- a/easybuild/easyblocks/p/pyzmq.py +++ b/easybuild/easyblocks/p/pyzmq.py @@ -44,9 +44,8 @@ def configure_step(self): self.sitecfg = """[build_ext] library_dirs = %(zmq)s/lib include_dirs = %(zmq)s/include -""" % { 'zmq': root_zmq } +""" % {'zmq': root_zmq} else: self.log.info("External ZeroMQ not found, PyZMQ will (try to) use shipped ZeroMQ.") super(EB_PyZMQ, self).configure_step() - From ee566a28a8b5d0dfafde32b0554ea454389cdc24 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:55:32 +0200 Subject: [PATCH 14/28] second pass of autopep8 --- easybuild/easyblocks/p/petsc.py | 4 ++-- easybuild/easyblocks/p/pgi.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/easybuild/easyblocks/p/petsc.py b/easybuild/easyblocks/p/petsc.py index 3ce02456e6..b153fb8e86 100644 --- a/easybuild/easyblocks/p/petsc.py +++ b/easybuild/easyblocks/p/petsc.py @@ -193,7 +193,7 @@ def configure_step(self): deps = [dep['name'] for dep in self.cfg.dependencies() if not dep['name'] in depfilter] for dep in deps: - if type(dep) == str: + if isinstance(dep, str): dep = (dep, dep) deproot = get_software_root(dep[0]) if deproot: @@ -249,7 +249,7 @@ def configure_step(self): if self.cfg['sourceinstall']: # figure out PETSC_ARCH setting - petsc_arch_regex = re.compile("^\s*PETSC_ARCH:\s*(\S+)$", re.M) + petsc_arch_regex = re.compile(r"^\s*PETSC_ARCH:\s*(\S+)$", re.M) res = petsc_arch_regex.search(out) if res: self.petsc_arch = res.group(1) diff --git a/easybuild/easyblocks/p/pgi.py b/easybuild/easyblocks/p/pgi.py index cbd660cf86..931d0a85e5 100644 --- a/easybuild/easyblocks/p/pgi.py +++ b/easybuild/easyblocks/p/pgi.py @@ -82,7 +82,7 @@ class EB_PGI(PackedBinary): def extra_options(): extra_vars = { 'install_amd': [True, "Install AMD software components", CUSTOM], - 'install_java': [True, "Install Java JRE for graphical debugger", CUSTOM], + 'install_java': [True, "Install Java JRE for graphical debugger", CUSTOM], 'install_managed': [True, "Install OpenACC Unified Memory Evaluation package", CUSTOM], 'install_nvidia': [True, "Install CUDA Toolkit Components", CUSTOM], } From 9e95e9e610264bb9f683db4fcdbf96579e819580 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:56:06 +0200 Subject: [PATCH 15/28] fix flake8 for p --- easybuild/easyblocks/p/petsc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/easybuild/easyblocks/p/petsc.py b/easybuild/easyblocks/p/petsc.py index b153fb8e86..cbeb3257d3 100644 --- a/easybuild/easyblocks/p/petsc.py +++ b/easybuild/easyblocks/p/petsc.py @@ -211,13 +211,13 @@ def configure_step(self): # specified order of libs matters! ss_libs = ["UMFPACK", "KLU", "CHOLMOD", "BTF", "CCOLAMD", "COLAMD", "CAMD", "AMD"] - suitesparse_inc = [os.path.join(suitesparse, l, "Include") - for l in ss_libs] + suitesparse_inc = [os.path.join(suitesparse, x, "Include") + for x in ss_libs] suitesparse_inc.append(os.path.join(suitesparse, "SuiteSparse_config")) inc_spec = "-include=[%s]" % ','.join(suitesparse_inc) - suitesparse_libs = [os.path.join(suitesparse, l, "Lib", "lib%s.a" % l.lower()) - for l in ss_libs] + suitesparse_libs = [os.path.join(suitesparse, x, "Lib", "lib%s.a" % x.lower()) + for x in ss_libs] suitesparse_libs.append(os.path.join(suitesparse, "SuiteSparse_config", "libsuitesparseconfig.a")) lib_spec = "-lib=[%s]" % ','.join(suitesparse_libs) else: @@ -225,8 +225,8 @@ def configure_step(self): withdep = "--with-umfpack" inc_spec = "-include=%s" % os.path.join(suitesparse, "UMFPACK", "Include") # specified order of libs matters! - umfpack_libs = [os.path.join(suitesparse, l, "Lib", "lib%s.a" % l.lower()) - for l in ["UMFPACK", "CHOLMOD", "COLAMD", "AMD"]] + umfpack_libs = [os.path.join(suitesparse, x, "Lib", "lib%s.a" % x.lower()) + for x in ["UMFPACK", "CHOLMOD", "COLAMD", "AMD"]] lib_spec = "-lib=[%s]" % ','.join(umfpack_libs) self.cfg.update('configopts', ' '.join([withdep + spec for spec in ['=1', inc_spec, lib_spec]])) From 7e0bebb27f792c302ae46ff05d4e3e233eab9b02 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:56:27 +0200 Subject: [PATCH 16/28] first pass of autopep8 --- easybuild/easyblocks/o/openifs.py | 3 +-- easybuild/easyblocks/o/openssl.py | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/easybuild/easyblocks/o/openifs.py b/easybuild/easyblocks/o/openifs.py index 2531a337ec..4621547875 100644 --- a/easybuild/easyblocks/o/openifs.py +++ b/easybuild/easyblocks/o/openifs.py @@ -52,7 +52,7 @@ def configure_step(self): env.setvar('OIFS_BUILD', 'opt') if self.toolchain.comp_family() == toolchain.GCC: env.setvar('OIFS_COMP', 'gnu') - elif self.toolchain.comp_family() == toolchain.INTELCOMP: + elif self.toolchain.comp_family() == toolchain.INTELCOMP: env.setvar('OIFS_COMP', 'intel') else: raise EasyBuildError("Unknown compiler used, don't know how to set $OIFS_COMP.") @@ -103,4 +103,3 @@ def sanity_check_step(self): } super(EB_OpenIFS, self).sanity_check_step(custom_paths=custom_paths) - diff --git a/easybuild/easyblocks/o/openssl.py b/easybuild/easyblocks/o/openssl.py index 96f66ff826..e536d6584a 100644 --- a/easybuild/easyblocks/o/openssl.py +++ b/easybuild/easyblocks/o/openssl.py @@ -44,7 +44,7 @@ def configure_step(self, cmd_prefix=''): """ Configure step """ - + cmd = "%s %s./config --prefix=%s threads shared %s" % (self.cfg['preconfigopts'], cmd_prefix, self.installdir, self.cfg['configopts']) @@ -65,16 +65,17 @@ def sanity_check_step(self): custom_paths = { 'files': [os.path.join(libdir, x) for x in ['libcrypto.a', 'libcrypto.so', 'libssl.a', 'libssl.so']] + - ['bin/openssl'], + ['bin/openssl'], 'dirs': [], } if LooseVersion(self.version) < LooseVersion("1.1"): - custom_paths['files'].extend([os.path.join(libdir, 'libcrypto.so.1.0.0'), os.path.join(libdir, 'libssl.so.1.0.0')]) + custom_paths['files'].extend([os.path.join(libdir, 'libcrypto.so.1.0.0'), + os.path.join(libdir, 'libssl.so.1.0.0')]) custom_paths['dirs'].append(os.path.join(libdir, 'engines')) else: - custom_paths['files'].extend([os.path.join(libdir, 'libcrypto.so.1.1'), os.path.join(libdir, 'libssl.so.1.1')]) + custom_paths['files'].extend([os.path.join(libdir, 'libcrypto.so.1.1'), + os.path.join(libdir, 'libssl.so.1.1')]) custom_paths['dirs'].append(os.path.join(libdir, 'engines-1.1')) super(EB_OpenSSL, self).sanity_check_step(custom_paths=custom_paths) - From 92b40a2d94a4f6c05868e20dc0e4938ba50584f3 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:57:03 +0200 Subject: [PATCH 17/28] fix flake8 for o --- easybuild/easyblocks/o/octave.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/easybuild/easyblocks/o/octave.py b/easybuild/easyblocks/o/octave.py index 8d193af422..a05c6416c2 100644 --- a/easybuild/easyblocks/o/octave.py +++ b/easybuild/easyblocks/o/octave.py @@ -30,12 +30,10 @@ """ import os -import easybuild.tools.environment as env from easybuild.easyblocks.generic.configuremake import ConfigureMake from easybuild.framework.easyconfig import CUSTOM from easybuild.tools.build_log import EasyBuildError from easybuild.tools.modules import get_software_root -from easybuild.tools.run import run_cmd EXTS_FILTER_OCTAVE_PACKAGES = ("octave --eval 'pkg list' | grep packages/%(ext_name)s-%(ext_version)s", '') From 115847f57d4a8fd78b5bd8664b440f415b5f26bc Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:58:18 +0200 Subject: [PATCH 18/28] fix setup.py for flake --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 33e196ed98..2af8179857 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ from distutils.core import setup sys.path.append('easybuild') -from easyblocks import VERSION +from easyblocks import VERSION # noqa FRAMEWORK_MAJVER = str(VERSION).split('.')[0] @@ -58,7 +58,8 @@ def read(fname): version=str(VERSION), author="EasyBuild community", author_email="easybuild@lists.ugent.be", - description="""Python modules which implement support for installing particular (groups of) software packages with EasyBuild.""", + description="""Python modules which implement support for installing particular + (groups of) software packages with EasyBuild.""", license="GPLv2", keywords="software build building installation installing compilation HPC scientific", url="https://easybuilders.github.io/easybuild", From e5f12afc184f636daa4b453823a5891f9c1ab100 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 12:59:03 +0200 Subject: [PATCH 19/28] fix easybuild/easyblocks/__init__.py for flake8 --- easybuild/easyblocks/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/__init__.py b/easybuild/easyblocks/__init__.py index 8c9827dddb..7fa1de2c3c 100644 --- a/easybuild/easyblocks/__init__.py +++ b/easybuild/easyblocks/__init__.py @@ -79,7 +79,7 @@ def get_git_revision(): VERBOSE_VERSION = LooseVersion("%s-r%s" % (VERSION, git_rev)) # extend path so python finds our easyblocks in the subdirectories where they are located -subdirs = [chr(l) for l in range(ord('a'), ord('z') + 1)] + ['0'] +subdirs = [chr(x) for x in range(ord('a'), ord('z') + 1)] + ['0'] for subdir in subdirs: __path__ = extend_path(__path__, '%s.%s' % (__name__, subdir)) From 60cc2902e5f99ecd3b02a7a898521f4968174bb7 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 13:01:12 +0200 Subject: [PATCH 20/28] fix tests for flake8 --- test/__init__.py | 2 +- test/easyblocks/general.py | 3 ++- test/easyblocks/init_easyblocks.py | 10 +++++----- test/easyblocks/module.py | 8 ++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/test/__init__.py b/test/__init__.py index d90fcf4771..b67524e91b 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -35,4 +35,4 @@ from pkgutil import extend_path # we're not the only ones in this namespace -__path__ = extend_path(__path__, __name__) #@ReservedAssignment +__path__ = extend_path(__path__, __name__) # @ReservedAssignment diff --git a/test/easyblocks/general.py b/test/easyblocks/general.py index 407ed7dd23..2303c9ef8f 100644 --- a/test/easyblocks/general.py +++ b/test/easyblocks/general.py @@ -101,7 +101,8 @@ def test_custom_easyblocks_repo(self): # determine path to where easybuild.framework is imported from, so we can hard set $PYTHONPATH # this is required to dance around issues with easy-install.pth files determining the actual Python search path - # see also http://blog.olgabotvinnik.com/blog/2014/03/03/2014-03-03-pythonpath-is-a-liar-site-py-and-easy-install-pth-tell/ + # see also + # http://blog.olgabotvinnik.com/blog/2014/03/03/2014-03-03-pythonpath-is-a-liar-site-py-and-easy-install-pth-tell/ import easybuild.framework framework_path = up(easybuild.framework.__file__, 3) diff --git a/test/easyblocks/init_easyblocks.py b/test/easyblocks/init_easyblocks.py index 76a812f599..ea569e0307 100644 --- a/test/easyblocks/init_easyblocks.py +++ b/test/easyblocks/init_easyblocks.py @@ -108,7 +108,7 @@ def check_extra_options_format(extra_options): self.assertTrue(isinstance(extra_options[key], list)) self.assertTrue(len(extra_options[key]), 3) - class_regex = re.compile("^class (.*)\(.*", re.M) + class_regex = re.compile(r"^class (.*)\(.*", re.M) self.log.debug("easyblock: %s" % easyblock) @@ -136,7 +136,7 @@ def check_extra_options_format(extra_options): if re.search('def prepare_step', txt): regex = re.compile(r"def prepare_step\(self, \*args, \*\*kwargs\):") self.assertTrue(regex.search(txt), "Pattern '%s' found in %s" % (regex.pattern, easyblock)) - if re.search('\.prepare_step\(', txt): + if re.search(r'\.prepare_step\(', txt): regex = re.compile(r"\.prepare_step\(.*\*args,.*\*\*kwargs\.*\)") self.assertTrue(regex.search(txt), "Pattern '%s' found in %s" % (regex.pattern, easyblock)) @@ -208,9 +208,9 @@ def suite(): exec(code, globals()) - innertest.__doc__ = "Test for initialisation of easyblock %s" % easyblock - innertest.__name__ = "test_easyblock_%s" % '_'.join(easyblock.replace('.py', '').split('/')) - setattr(InitTest, innertest.__name__, innertest) + innertest.__doc__ = "Test for initialisation of easyblock %s" % easyblock # noqa + innertest.__name__ = "test_easyblock_%s" % '_'.join(easyblock.replace('.py', '').split('/')) # noqa + setattr(InitTest, innertest.__name__, innertest) # noqa return TestLoader().loadTestsFromTestCase(InitTest) diff --git a/test/easyblocks/module.py b/test/easyblocks/module.py index b3a955a021..57a2974992 100644 --- a/test/easyblocks/module.py +++ b/test/easyblocks/module.py @@ -199,7 +199,7 @@ def template_module_only_test(self, easyblock, name='foo', version='1.3.2', extr tmpdir = tempfile.mkdtemp() - class_regex = re.compile("^class (.*)\(.*", re.M) + class_regex = re.compile(r"^class (.*)\(.*", re.M) self.log.debug("easyblock: %s" % easyblock) @@ -389,9 +389,9 @@ def suite(): exec(code, globals()) - innertest.__doc__ = "Test for using --module-only with easyblock %s" % easyblock - innertest.__name__ = "test_easyblock_%s" % '_'.join(easyblock.replace('.py', '').split('/')) - setattr(ModuleOnlyTest, innertest.__name__, innertest) + innertest.__doc__ = "Test for using --module-only with easyblock %s" % easyblock # noqa + innertest.__name__ = "test_easyblock_%s" % '_'.join(easyblock.replace('.py', '').split('/')) # noqa + setattr(ModuleOnlyTest, innertest.__name__, innertest) # noqa return TestLoader().loadTestsFromTestCase(ModuleOnlyTest) From 579aa9c61ed565c2b09a8a63395b7c88a2cdaaed Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 13:13:21 +0200 Subject: [PATCH 21/28] fix for r again --- easybuild/easyblocks/r/__init__.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/easybuild/easyblocks/r/__init__.py b/easybuild/easyblocks/r/__init__.py index e69de29bb2..6dda569ca9 100644 --- a/easybuild/easyblocks/r/__init__.py +++ b/easybuild/easyblocks/r/__init__.py @@ -0,0 +1,30 @@ +## +# Copyright 2009-2020 Ghent University +# +# This file is part of EasyBuild, +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), +# with support of Ghent University (http://ugent.be/hpc), +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), +# Flemish Research Foundation (FWO) (http://www.fwo.be/en) +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). +# +# https://github.com/easybuilders/easybuild +# +# EasyBuild is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation v2. +# +# EasyBuild is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with EasyBuild. If not, see . +## +""" +Special handling of R easyblocks, due to clash with easybuild.easyblocks.r namespace. + +author: Kenneth Hoste (Ghent University) +""" +from easybuild.easyblocks.r.r import * # noqa From cd76c15dbdf8a709fc6617080e5d4d8caa5e41cf Mon Sep 17 00:00:00 2001 From: wpoely86 Date: Thu, 20 Aug 2020 13:36:56 +0200 Subject: [PATCH 22/28] Update easybuild/easyblocks/p/pasha.py Co-authored-by: Kenneth Hoste --- easybuild/easyblocks/p/pasha.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/p/pasha.py b/easybuild/easyblocks/p/pasha.py index 9eada395f1..860517290c 100644 --- a/easybuild/easyblocks/p/pasha.py +++ b/easybuild/easyblocks/p/pasha.py @@ -47,8 +47,8 @@ def configure_step(self): raise EasyBuildError("TBB module not loaded.") self.cfg.update('buildopts', "TBB_DIR=%s/tbb MPI_DIR='' MPI_INC='' " % tbb) - self.cfg.update('buildopts', 'MPI_CXX="%s" OPM_FLAG="%s"' % - (os.getenv('MPICXX'), self.toolchain.get_flag('openmp'))) + self.cfg.update('buildopts', 'MPI_CXX="%s"' % os.getenv('MPICXX')) + self.cfg.update('buildopts', 'OPM_FLAG="%s"' % self.toolchain.get_flag('openmp')) self.cfg.update('buildopts', 'MPI_LIB="" MY_CXX="%s" MPICH_IGNORE_CXX_SEEK=1' % os.getenv('CXX')) def install_step(self): From 29bcd54e2d84855190fb4616192b9707920a8852 Mon Sep 17 00:00:00 2001 From: wpoely86 Date: Thu, 20 Aug 2020 13:37:35 +0200 Subject: [PATCH 23/28] Update easybuild/easyblocks/s/stata.py Co-authored-by: Kenneth Hoste --- easybuild/easyblocks/s/stata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/s/stata.py b/easybuild/easyblocks/s/stata.py index a49270bb5a..adae036394 100644 --- a/easybuild/easyblocks/s/stata.py +++ b/easybuild/easyblocks/s/stata.py @@ -58,8 +58,8 @@ def install_step(self): ] run_cmd_qa(cmd, {}, no_qa=no_qa, std_qa=std_qa, log_all=True, simple=True) - print_msg("Note: you need to manually run ./stinit in %s to initialise the license for Stata!" - % self.installdir) + print_msg("Note: you need to manually run ./stinit in %s to initialise the license for Stata!", + self.installdir) def sanity_check_step(self): """Custom sanity check for Stata.""" From 830d3feda7f938ae8c4871747c74fd27e091d6a8 Mon Sep 17 00:00:00 2001 From: wpoely86 Date: Thu, 20 Aug 2020 13:37:51 +0200 Subject: [PATCH 24/28] Update easybuild/easyblocks/t/totalview.py Co-authored-by: Kenneth Hoste --- easybuild/easyblocks/t/totalview.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/t/totalview.py b/easybuild/easyblocks/t/totalview.py index c82b248eee..fcc26afcc0 100644 --- a/easybuild/easyblocks/t/totalview.py +++ b/easybuild/easyblocks/t/totalview.py @@ -92,6 +92,6 @@ def make_module_req_guess(self): def make_module_extra(self): """Add extra environment variables for license file and anything else.""" txt = super(EB_TotalView, self).make_module_extra() - txt += self.module_generator.prepend_paths(self.license_env_var, - [self.license_file], allow_abs=True, expand_relpaths=False) + txt += self.module_generator.prepend_paths(self.license_env_var, [self.license_file], + allow_abs=True, expand_relpaths=False) return txt From 01400a04fd4b8c76d507ae31d098d7c68485e85d Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 13:40:31 +0200 Subject: [PATCH 25/28] fix remarks --- easybuild/easyblocks/p/petsc.py | 3 ++- easybuild/easyblocks/p/primer3.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/easybuild/easyblocks/p/petsc.py b/easybuild/easyblocks/p/petsc.py index cbeb3257d3..3308a33166 100644 --- a/easybuild/easyblocks/p/petsc.py +++ b/easybuild/easyblocks/p/petsc.py @@ -40,6 +40,7 @@ from easybuild.tools.modules import get_software_root from easybuild.tools.run import run_cmd from easybuild.tools.systemtools import get_shared_lib_ext +from easybuild.tools.py2vs3 import string_type NO_MPI_CXX_EXT_FLAGS = '-DOMPI_SKIP_MPICXX -DMPICH_SKIP_MPICXX' @@ -193,7 +194,7 @@ def configure_step(self): deps = [dep['name'] for dep in self.cfg.dependencies() if not dep['name'] in depfilter] for dep in deps: - if isinstance(dep, str): + if isinstance(dep, string_type): dep = (dep, dep) deproot = get_software_root(dep[0]) if deproot: diff --git a/easybuild/easyblocks/p/primer3.py b/easybuild/easyblocks/p/primer3.py index 09497a1be7..ce6a497406 100644 --- a/easybuild/easyblocks/p/primer3.py +++ b/easybuild/easyblocks/p/primer3.py @@ -60,9 +60,10 @@ def guess_start_dir(self): def configure_step(self): """Configure Primer3 build by setting make options.""" - self.cfg.update('buildopts', 'CC="%s" CPP="%s" O_OPTS="%s" all' % (os.getenv('CC'), - os.getenv('CXX'), - os.getenv('CFLAGS'))) + self.cfg.update('buildopts', 'CC="%s"' % (os.getenv('CC'))) + self.cfg.update('buildopts', 'CPP="%s"' % (os.getenv('CXX'))) + self.cfg.update('buildopts', 'O_OPTS="%s"' % (os.getenv('CFLAGS'))) + self.cfg.update('buildopts', 'all') # default build_step should be fine From f589b8c0b890309b6739d045f6afe79394e03eb3 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 13:58:48 +0200 Subject: [PATCH 26/28] try to fix tests more elegant by suggestion of Flamefire --- test/easyblocks/module.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/test/easyblocks/module.py b/test/easyblocks/module.py index 57a2974992..c44b117f10 100644 --- a/test/easyblocks/module.py +++ b/test/easyblocks/module.py @@ -331,6 +331,11 @@ def template_module_only_test(self, easyblock, name='foo', version='1.3.2', extr def suite(): """Return all easyblock --module-only tests.""" + def make_inner_test(easyblock, **kwargs): + def innertest(self): + template_module_only_test(self, easyblock, kwargs) + return innertest + # initialize configuration (required for e.g. default modules_tool setting) cleanup() eb_go = eboptions.parse_options(args=['--prefix=%s' % TMPDIR]) @@ -368,30 +373,24 @@ def suite(): # dynamically define new inner functions that can be added as class methods to ModuleOnlyTest if os.path.basename(easyblock) == 'systemcompiler.py': # use GCC as name when testing SystemCompiler easyblock - code = "def innertest(self): " - code += "template_module_only_test(self, '%s', name='GCC', version='system')" % easyblock + innertest = make_inner_test(easyblock, name='GCC', version='system') elif os.path.basename(easyblock) == 'systemmpi.py': # use OpenMPI as name when testing SystemMPI easyblock - code = "def innertest(self): " - code += "template_module_only_test(self, '%s', name='OpenMPI', version='system')" % easyblock + innertest = make_inner_test(easyblock, name='OpenMPI', version='system') elif os.path.basename(easyblock) == 'craytoolchain.py': # make sure that a (known) PrgEnv is included as a dependency extra_txt = 'dependencies = [("PrgEnv-gnu/1.2.3", EXTERNAL_MODULE)]' - code = "def innertest(self): " - code += "template_module_only_test(self, '%s', extra_txt='%s')" % (easyblock, extra_txt) + innertest = make_inner_test(easyblock, extra_txt=extra_txt) elif os.path.basename(easyblock) == 'modulerc.py': # exactly one dependency is included with ModuleRC generic easyblock (and name must match) extra_txt = 'dependencies = [("foo", "1.2.3.4.5")]' - code = "def innertest(self): " - code += "template_module_only_test(self, '%s', version='1.2.3.4', extra_txt='%s')" % (easyblock, extra_txt) + innertest = make_inner_test(easyblock, version='1.2.3.4', extra_txt=extra_txt) else: - code = "def innertest(self): template_module_only_test(self, '%s')" % easyblock - - exec(code, globals()) + innertest = make_inner_test(easyblock) - innertest.__doc__ = "Test for using --module-only with easyblock %s" % easyblock # noqa - innertest.__name__ = "test_easyblock_%s" % '_'.join(easyblock.replace('.py', '').split('/')) # noqa - setattr(ModuleOnlyTest, innertest.__name__, innertest) # noqa + innertest.__doc__ = "Test for using --module-only with easyblock %s" % easyblock + innertest.__name__ = "test_easyblock_%s" % '_'.join(easyblock.replace('.py', '').split('/')) + setattr(ModuleOnlyTest, innertest.__name__, innertest) return TestLoader().loadTestsFromTestCase(ModuleOnlyTest) From f421b894469da5e44d58f0d2edc956c3f7209a63 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 14:00:01 +0200 Subject: [PATCH 27/28] use kwargs properly --- test/easyblocks/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/easyblocks/module.py b/test/easyblocks/module.py index c44b117f10..d49ccee99e 100644 --- a/test/easyblocks/module.py +++ b/test/easyblocks/module.py @@ -333,7 +333,7 @@ def suite(): """Return all easyblock --module-only tests.""" def make_inner_test(easyblock, **kwargs): def innertest(self): - template_module_only_test(self, easyblock, kwargs) + template_module_only_test(self, easyblock, **kwargs) return innertest # initialize configuration (required for e.g. default modules_tool setting) From a02a31b1b78898930e4d99496d9e47926c3b028d Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Thu, 20 Aug 2020 15:22:21 +0200 Subject: [PATCH 28/28] fix second part also --- test/easyblocks/init_easyblocks.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/easyblocks/init_easyblocks.py b/test/easyblocks/init_easyblocks.py index ea569e0307..62f968edd4 100644 --- a/test/easyblocks/init_easyblocks.py +++ b/test/easyblocks/init_easyblocks.py @@ -189,6 +189,10 @@ def check_extra_options_format(extra_options): def suite(): """Return all easyblock initialisation tests.""" + def make_inner_test(easyblock, **kwargs): + def innertest(self): + template_init_test(self, easyblock, **kwargs) + return innertest # dynamically generate a separate test for each of the available easyblocks easyblocks_path = get_paths_for("easyblocks")[0] @@ -199,18 +203,16 @@ def suite(): # dynamically define new inner functions that can be added as class methods to InitTest if os.path.basename(easyblock) == 'systemcompiler.py': # use GCC as name when testing SystemCompiler easyblock - code = "def innertest(self): template_init_test(self, '%s', name='GCC', version='system')" % easyblock + innertest = make_inner_test(easyblock, name='GCC', version='system') elif os.path.basename(easyblock) == 'systemmpi.py': # use OpenMPI as name when testing SystemMPI easyblock - code = "def innertest(self): template_init_test(self, '%s', name='OpenMPI', version='system')" % easyblock + innertest = make_inner_test(easyblock, name='OpenMPI', version='system') else: - code = "def innertest(self): template_init_test(self, '%s')" % easyblock + innertest = make_inner_test(easyblock) - exec(code, globals()) - - innertest.__doc__ = "Test for initialisation of easyblock %s" % easyblock # noqa - innertest.__name__ = "test_easyblock_%s" % '_'.join(easyblock.replace('.py', '').split('/')) # noqa - setattr(InitTest, innertest.__name__, innertest) # noqa + innertest.__doc__ = "Test for initialisation of easyblock %s" % easyblock + innertest.__name__ = "test_easyblock_%s" % '_'.join(easyblock.replace('.py', '').split('/')) + setattr(InitTest, innertest.__name__, innertest) return TestLoader().loadTestsFromTestCase(InitTest)