Skip to content

Commit d0b4a60

Browse files
committed
add support to PythonPackage easyblock to disable use of --no-build-isolation option for 'pip install'
1 parent 2e5a227 commit d0b4a60

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

easybuild/easyblocks/generic/pythonpackage.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ def extra_options(extra_vars=None):
404404
"Defaults to '.' for unpacked sources or the first source file specified", CUSTOM],
405405
'install_target': ['install', "Option to pass to setup.py", CUSTOM],
406406
'pip_ignore_installed': [True, "Let pip ignore installed Python packages (i.e. don't remove them)", CUSTOM],
407+
'pip_no_build_isolation': [True, "Use --no-build-isolation with pip install", CUSTOM],
407408
'pip_no_index': [None, "Pass --no-index to pip to disable connecting to PyPi entirely which also disables "
408409
"the pip version check. Enabled by default when pip_ignore_installed=True", CUSTOM],
409410
'pip_verbose': [None, "Pass --verbose to 'pip install' (if pip is used). "
@@ -635,8 +636,10 @@ def compose_install_command(self, prefix, extrapath=None, installopts=None):
635636
# (see also https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support);
636637
# since we provide all required dependencies already, we disable this via --no-build-isolation
637638
if LooseVersion(pip_version) >= LooseVersion('10.0'):
638-
if '--no-build-isolation' not in self.cfg['installopts']:
639-
self.py_installopts.append('--no-build-isolation')
639+
pip_no_build_isolation = self.cfg.get('pip_no_build_isolation', True)
640+
no_build_isolation_flag = '--no-build-isolation'
641+
if pip_no_build_isolation and no_build_isolation_flag not in self.cfg['installopts']:
642+
self.py_installopts.append(no_build_isolation_flag)
640643

641644
elif not self.dry_run:
642645
raise EasyBuildError("Failed to determine pip version!")

0 commit comments

Comments
 (0)