diff --git a/easybuild/easyblocks/e/easybuildmeta.py b/easybuild/easyblocks/e/easybuildmeta.py index 20d12874e9..2f412e5218 100644 --- a/easybuild/easyblocks/e/easybuildmeta.py +++ b/easybuild/easyblocks/e/easybuildmeta.py @@ -33,7 +33,7 @@ import sys from collections import OrderedDict -from easybuild.easyblocks.generic.pythonpackage import PythonPackage, det_pip_version +from easybuild.easyblocks.generic.pythonpackage import PythonPackage from easybuild.tools import LooseVersion from easybuild.tools.build_log import EasyBuildError from easybuild.tools.filetools import apply_regex_substitutions, change_dir, read_file @@ -66,27 +66,6 @@ def __init__(self, *args, **kwargs): # consider setuptools first, in case it is listed as a sources self.easybuild_pkgs.insert(0, 'setuptools') - # opt-in to using pip for recent version of EasyBuild, if: - # - EasyBuild is being installed for Python >= 3.6; - # - pip is available, and recent enough (>= 21.0); - # - use_pip is not specified; - pyver = sys.version.split(' ')[0] - self.log.info("Python version: %s", pyver) - if sys.version_info >= (3, 6) and self.cfg['use_pip'] is None: - # try to determine pip version, ignore any failures that occur while doing so; - # problems may occur due changes in environment ($PYTHONPATH, etc.) - pip_version = None - try: - pip_version = det_pip_version(python_cmd=sys.executable) - self.log.info("Found Python v%s + pip: %s", pyver, pip_version) - except Exception as err: - self.log.warning("Failed to determine pip version: %s", err) - - if pip_version and LooseVersion(pip_version) >= LooseVersion('21.0'): - self.log.info("Auto-enabling use of pip to install EasyBuild!") - self.cfg['use_pip'] = True - self.determine_install_command() - # Override this function since we want to respect the user choice for the python installation to use # (which can be influenced by EB_PYTHON and EB_INSTALLPYTHON) def prepare_python(self): diff --git a/easybuild/easyblocks/generic/pythonbundle.py b/easybuild/easyblocks/generic/pythonbundle.py index 292cc275aa..fa2d6a39c8 100644 --- a/easybuild/easyblocks/generic/pythonbundle.py +++ b/easybuild/easyblocks/generic/pythonbundle.py @@ -69,9 +69,6 @@ def __init__(self, *args, **kwargs): if key not in self.cfg['exts_default_options']: self.cfg['exts_default_options'][key] = self.cfg[key] - self.cfg['exts_default_options']['download_dep_fail'] = True - self.log.info("Detection of downloaded extension dependencies is enabled") - self.log.info("exts_default_options: %s", self.cfg['exts_default_options']) self.pylibdir = None diff --git a/easybuild/easyblocks/generic/pythonpackage.py b/easybuild/easyblocks/generic/pythonpackage.py index 1acbcccc25..0db208dfcb 100644 --- a/easybuild/easyblocks/generic/pythonpackage.py +++ b/easybuild/easyblocks/generic/pythonpackage.py @@ -337,7 +337,7 @@ def extra_options(extra_vars=None): "Otherwise it will be used as-is. A value of None then skips the build step. " "The template %(python)s will be replace by the currently used Python binary.", CUSTOM], 'check_ldshared': [None, 'Check Python value of $LDSHARED, correct if needed to "$CC -shared"', CUSTOM], - 'download_dep_fail': [None, "Fail if downloaded dependencies are detected", CUSTOM], + 'download_dep_fail': [True, "Fail if downloaded dependencies are detected", CUSTOM], 'install_src': [None, "Source path to pass to the install command (e.g. a whl file)." "Defaults to '.' for unpacked sources or the first source file specified", CUSTOM], 'install_target': ['install', "Option to pass to setup.py", CUSTOM], @@ -348,8 +348,8 @@ def extra_options(extra_vars=None): "Enabled by default if the EB option --debug is used.", CUSTOM], 'req_py_majver': [None, "Required major Python version (only relevant when using system Python)", CUSTOM], 'req_py_minver': [None, "Required minor Python version (only relevant when using system Python)", CUSTOM], - 'sanity_pip_check': [False, "Run 'python -m pip check' to ensure all required Python packages are " - "installed and check for any package with an invalid (0.0.0) version.", CUSTOM], + 'sanity_pip_check': [True, "Run 'python -m pip check' to ensure all required Python packages are " + "installed and check for any package with an invalid (0.0.0) version.", CUSTOM], 'runtest': [True, "Run unit tests.", CUSTOM], # overrides default 'testinstall': [False, "Install into temporary directory prior to running the tests.", CUSTOM], 'unpack_sources': [None, "Unpack sources prior to build/install. Defaults to 'True' except for whl files", @@ -358,7 +358,7 @@ def extra_options(extra_vars=None): # version. Those would fail the (extended) sanity_pip_check. So as a last resort they can be added here # and will be excluded from that check. Note that the display name is required, i.e. from `pip list`. 'unversioned_packages': [[], "List of packages that don't have a version at all, i.e. show 0.0.0", CUSTOM], - 'use_pip': [None, "Install using '%s'" % PIP_INSTALL_CMD, CUSTOM], + 'use_pip': [True, "Install using '%s'" % PIP_INSTALL_CMD, CUSTOM], 'use_pip_editable': [False, "Install using 'pip install --editable'", CUSTOM], # see https://packaging.python.org/tutorials/installing-packages/#installing-setuptools-extras 'use_pip_extras': [None, "String with comma-separated list of 'extras' to install via pip", CUSTOM], @@ -427,7 +427,7 @@ def determine_install_command(self): """ Determine install command to use. """ - if self.cfg.get('use_pip', False) or self.cfg.get('use_pip_editable', False): + if self.cfg.get('use_pip', True) or self.cfg.get('use_pip_editable', False): self.install_cmd = PIP_INSTALL_CMD pip_verbose = self.cfg.get('pip_verbose', None) @@ -450,7 +450,7 @@ def determine_install_command(self): self.py_installopts.append('--egg') pip_no_index = self.cfg.get('pip_no_index', None) - if pip_no_index or (pip_no_index is None and self.cfg.get('download_dep_fail')): + if pip_no_index or (pip_no_index is None and self.cfg.get('download_dep_fail', True)): self.py_installopts.append('--no-index') # avoid that pip (ab)uses $HOME/.cache/pip @@ -970,7 +970,7 @@ def sanity_check_step(self, *args, **kwargs): # see also https://github.com/easybuilders/easybuild-easyblocks/issues/1877 env.setvar('PYTHONNOUSERSITE', '1', verbose=False) - if self.cfg.get('download_dep_fail', False): + if self.cfg.get('download_dep_fail', True): self.log.info("Detection of downloaded depenencies enabled, checking output of installation command...") patterns = [ 'Downloading .*/packages/.*', # setuptools @@ -1014,7 +1014,7 @@ def sanity_check_step(self, *args, **kwargs): exts_filter = (orig_exts_filter[0].replace('python', self.python_cmd), orig_exts_filter[1]) kwargs.update({'exts_filter': exts_filter}) - if self.cfg.get('sanity_pip_check', False): + if self.cfg.get('sanity_pip_check', True): pip_version = det_pip_version(python_cmd=python_cmd) if pip_version: diff --git a/easybuild/easyblocks/j/jaxlib.py b/easybuild/easyblocks/j/jaxlib.py index ad6fa016f5..bdfc15dbf0 100644 --- a/easybuild/easyblocks/j/jaxlib.py +++ b/easybuild/easyblocks/j/jaxlib.py @@ -51,7 +51,6 @@ def extra_options(): """Custom easyconfig parameters specific to jaxlib.""" extra_vars = PythonPackage.extra_options() - extra_vars['use_pip'][0] = True # Run custom build script and install the generated whl file extra_vars['buildcmd'][0] = '%(python)s build/build.py' extra_vars['install_src'][0] = 'dist/*.whl' diff --git a/easybuild/easyblocks/n/numexpr.py b/easybuild/easyblocks/n/numexpr.py index e5d192fff2..e6152738b6 100644 --- a/easybuild/easyblocks/n/numexpr.py +++ b/easybuild/easyblocks/n/numexpr.py @@ -37,16 +37,6 @@ class EB_numexpr(PythonPackage): """Support for building/installing numexpr.""" - @staticmethod - def extra_options(): - """Override some custom easyconfig parameters specifically for numexpr.""" - extra_vars = PythonPackage.extra_options() - - extra_vars['download_dep_fail'][0] = True - extra_vars['use_pip'][0] = True - - return extra_vars - def __init__(self, *args, **kwargs): """Initialisation of custom class variables for numexpr.""" super(EB_numexpr, self).__init__(*args, **kwargs) diff --git a/easybuild/easyblocks/p/pybind11.py b/easybuild/easyblocks/p/pybind11.py index 8106bc3b40..b0db8eec21 100644 --- a/easybuild/easyblocks/p/pybind11.py +++ b/easybuild/easyblocks/p/pybind11.py @@ -45,15 +45,6 @@ class EB_pybind11(CMakePythonPackage): Python packages using `import pybind11` Hence we need to install PyBind11 twice: Once with CMake and once with pip """ - @staticmethod - def extra_options(extra_vars=None): - """Easyconfig parameters specific to PyBind11: Set defaults""" - extra_vars = PythonPackage.extra_options(extra_vars=extra_vars) - extra_vars = CMakeMake.extra_options(extra_vars=extra_vars) - extra_vars['use_pip'][0] = True - extra_vars['sanity_pip_check'][0] = True - extra_vars['download_dep_fail'][0] = True - return extra_vars def configure_step(self): """Avoid that a system Python is picked up when a Python module is loaded""" diff --git a/easybuild/easyblocks/p/pytorch.py b/easybuild/easyblocks/p/pytorch.py index 11c2490371..30d8082d24 100644 --- a/easybuild/easyblocks/p/pytorch.py +++ b/easybuild/easyblocks/p/pytorch.py @@ -59,9 +59,6 @@ def extra_options(): # see also https://github.com/easybuilders/easybuild-easyblocks/pull/3022 extra_vars['use_pip'][0] = None - extra_vars['download_dep_fail'][0] = True - extra_vars['sanity_pip_check'][0] = True - # Make pip show output of build process as that may often contain errors or important warnings extra_vars['pip_verbose'][0] = True diff --git a/easybuild/easyblocks/s/sympy.py b/easybuild/easyblocks/s/sympy.py index 15e5186231..505aa70071 100644 --- a/easybuild/easyblocks/s/sympy.py +++ b/easybuild/easyblocks/s/sympy.py @@ -38,15 +38,6 @@ class EB_sympy(PythonPackage): """Custom easyblock for installing the sympy Python package.""" - @staticmethod - def extra_options(extra_vars=None): - """Customize default value for easyconfig parameters for sympy""" - extra_vars = PythonPackage.extra_options(extra_vars=extra_vars) - extra_vars['use_pip'][0] = True - extra_vars['sanity_pip_check'][0] = True - extra_vars['download_dep_fail'][0] = True - return extra_vars - def test_step(self): """Custom test step for sympy""" diff --git a/easybuild/easyblocks/t/tensorflow.py b/easybuild/easyblocks/t/tensorflow.py index 174a5e38fe..3b3bcf8d91 100644 --- a/easybuild/easyblocks/t/tensorflow.py +++ b/easybuild/easyblocks/t/tensorflow.py @@ -255,8 +255,6 @@ def __init__(self, *args, **kwargs): with self.cfg.disable_templating(): self.cfg['exts_defaultclass'] = 'PythonPackage' - self.cfg['exts_default_options']['download_dep_fail'] = True - self.cfg['exts_default_options']['use_pip'] = True self.cfg['exts_filter'] = EXTS_FILTER_PYTHON_PACKAGES self.system_libs_info = None diff --git a/easybuild/easyblocks/t/tensorrt.py b/easybuild/easyblocks/t/tensorrt.py index 493b731bc3..1396e6caee 100644 --- a/easybuild/easyblocks/t/tensorrt.py +++ b/easybuild/easyblocks/t/tensorrt.py @@ -67,11 +67,6 @@ def __init__(self, *args, **kwargs): # Setup for the extensions step self.cfg['exts_defaultclass'] = 'PythonPackage' - self.cfg['exts_default_options'] = { - 'download_dep_fail': True, - 'use_pip': True, - } - def configure_step(self): """Custom configuration procedure for TensorRT.""" pass diff --git a/easybuild/easyblocks/t/torchvision.py b/easybuild/easyblocks/t/torchvision.py index 5536b89139..d0c8913db8 100644 --- a/easybuild/easyblocks/t/torchvision.py +++ b/easybuild/easyblocks/t/torchvision.py @@ -38,15 +38,6 @@ class EB_torchvision(PythonPackage): """Support for building/installing TorchVison.""" - @staticmethod - def extra_options(): - """Change some defaults for easyconfig parameters.""" - extra_vars = PythonPackage.extra_options() - extra_vars['use_pip'][0] = True - extra_vars['download_dep_fail'][0] = True - extra_vars['sanity_pip_check'][0] = True - return extra_vars - def __init__(self, *args, **kwargs): """Initialize torchvision easyblock.""" super(EB_torchvision, self).__init__(*args, **kwargs)