diff --git a/.flake8.ini b/.flake8.ini deleted file mode 100644 index b20ffbc2b1..0000000000 --- a/.flake8.ini +++ /dev/null @@ -1,7 +0,0 @@ -[flake8] -max-line-length = 120 - -# Hound CI runs with Python 3 (no way around it), -# so we need to specify some Python 2 builtins to avoid that it complains about them -# cfr. https://stackoverflow.com/questions/47427916/how-to-config-hound-ci-to-support-python2-7 -builtins = 'basestring' diff --git a/.hound.yml b/.hound.yml index 2916903576..9449e4f823 100644 --- a/.hound.yml +++ b/.hound.yml @@ -1,4 +1,4 @@ # configuration for houndci, see https://houndci.com/configuration#python flake8: enabled: true - config_file: .flake8.ini + config_file: setup.cfg diff --git a/easybuild/tools/options.py b/easybuild/tools/options.py index f35dd0b3da..339bf1f33d 100644 --- a/easybuild/tools/options.py +++ b/easybuild/tools/options.py @@ -47,7 +47,6 @@ from vsc.utils import fancylogger from vsc.utils.fancylogger import setLogLevel from vsc.utils.generaloption import GeneralOption -from vsc.utils.missing import nub import easybuild.tools.environment as env from easybuild.framework.easyblock import MODULE_ONLY_STEPS, SOURCE_STEP, FETCH_STEP, EasyBlock @@ -56,7 +55,7 @@ from easybuild.framework.easyconfig.format.pyheaderconfigobj import build_easyconfig_constants_dict from easybuild.framework.easyconfig.tools import get_paths_for from easybuild.tools import build_log, run # build_log should always stay there, to ensure EasyBuildLog -from easybuild.tools.build_log import DEVEL_LOG_LEVEL, EasyBuildError, print_warning, raise_easybuilderror +from easybuild.tools.build_log import DEVEL_LOG_LEVEL, EasyBuildError, raise_easybuilderror from easybuild.tools.config import CONT_IMAGE_FORMATS, CONT_TYPES, DEFAULT_CONT_TYPE from easybuild.tools.config import DEFAULT_ALLOW_LOADED_MODULES, DEFAULT_FORCE_DOWNLOAD, DEFAULT_JOB_BACKEND from easybuild.tools.config import DEFAULT_LOGFILE_FORMAT, DEFAULT_MAX_FAIL_RATIO_PERMS, DEFAULT_MNS @@ -71,7 +70,7 @@ from easybuild.tools.docs import avail_toolchain_opts, avail_easyconfig_params, avail_easyconfig_templates from easybuild.tools.docs import list_easyblocks, list_toolchains from easybuild.tools.environment import restore_env, unset_env_vars -from easybuild.tools.filetools import CHECKSUM_TYPE_SHA256, CHECKSUM_TYPES, mkdir +from easybuild.tools.filetools import CHECKSUM_TYPE_SHA256, CHECKSUM_TYPES from easybuild.tools.github import GITHUB_EB_MAIN, GITHUB_EASYCONFIGS_REPO, HAVE_GITHUB_API, HAVE_KEYRING from easybuild.tools.github import fetch_github_token from easybuild.tools.hooks import KNOWN_HOOKS @@ -86,7 +85,6 @@ from easybuild.tools.run import run_cmd from easybuild.tools.package.utilities import avail_package_naming_schemes from easybuild.tools.toolchain.compiler import DEFAULT_OPT_LEVEL, OPTARCH_MAP_CHAR, OPTARCH_SEP, Compiler -from easybuild.tools.toolchain.utilities import search_toolchain from easybuild.tools.repository.repository import avail_repositories from easybuild.tools.version import this_is_easybuild @@ -101,6 +99,7 @@ def terminal_supports_colors(stream): # in case of errors do not bother and just return the safe default return False + # monkey patch shell_quote in vsc.utils.generaloption, used by generate_cmd_line, # to fix known issue, cfr. https://github.com/hpcugent/vsc-base/issues/152; # inspired by https://github.com/hpcugent/vsc-base/pull/151 @@ -117,6 +116,7 @@ def eb_shell_quote(token): # escape any non-escaped single quotes, and wrap entire token in single quotes return "'%s'" % re.sub(r"(?= 2.6, python < 3 [easy_install] +[flake8] +max-line-length = 120 + +# Hound CI runs with Python 3 (no way around it), +# so we need to specify some Python 2 builtins to avoid that it complains about them +# cfr. https://stackoverflow.com/questions/47427916/how-to-config-hound-ci-to-support-python2-7 +builtins = + basestring, + reduce