Skip to content

Commit 2798a9a

Browse files
authored
Merge pull request #3722 from Flamefire/download_dep_fail-pypackage
allow downloaded Python packages if implicitely requested
2 parents f9a89fe + b8cd571 commit 2798a9a

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

easybuild/easyblocks/generic/pythonpackage.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,9 @@ def extra_options(extra_vars=None):
514514
"Otherwise it will be used as-is. A value of None then skips the build step. "
515515
"The template %(python)s will be replace by the currently used Python binary.", CUSTOM],
516516
'check_ldshared': [None, 'Check Python value of $LDSHARED, correct if needed to "$CC -shared"', CUSTOM],
517-
'download_dep_fail': [True, "Fail if downloaded dependencies are detected", CUSTOM],
517+
'download_dep_fail': [None, "Fail if downloaded dependencies are detected. "
518+
"Defaults to True unless 'use_pip_for_deps' or 'use_pip_requirement' is True.",
519+
CUSTOM],
518520
'fix_python_shebang_for': [['bin/*'], "List of files for which Python shebang should be fixed "
519521
"to '#!/usr/bin/env python' (glob patterns supported) "
520522
"(default: ['bin/*'])", CUSTOM],
@@ -589,13 +591,18 @@ def __init__(self, *args, **kwargs):
589591
self.log.info("Using default value for expected module name (lowercase software name): '%s'",
590592
self.options['modulename'])
591593

592-
# only for Python packages installed as extensions:
593-
# inherit setting for detection of downloaded dependencies from parent,
594-
# if 'download_dep_fail' was left unspecified
595-
if self.is_extension and self.cfg.get('download_dep_fail') is None:
596-
self.cfg['download_dep_fail'] = self.master.cfg['exts_download_dep_fail']
597-
self.log.info("Inherited setting for detection of downloaded dependencies from parent: %s",
598-
self.cfg['download_dep_fail'])
594+
# Set default if 'download_dep_fail' was left unspecified
595+
if self.cfg.get('download_dep_fail') is None:
596+
if self.cfg.get('use_pip_for_deps') or self.cfg.get('use_pip_requirement'):
597+
self.cfg['download_dep_fail'] = False # Those 2 options will always download dependencies
598+
elif self.is_extension:
599+
# only for Python packages installed as extensions:
600+
# inherit setting for detection of downloaded dependencies from parent,
601+
self.cfg['download_dep_fail'] = self.master.cfg['exts_download_dep_fail']
602+
self.log.info("Inherited setting for detection of downloaded dependencies from parent: %s",
603+
self.cfg['download_dep_fail'])
604+
else:
605+
self.cfg['download_dep_fail'] = True
599606

600607
# figure out whether this Python package is being installed for multiple Python versions
601608
self.multi_python = 'Python' in self.cfg['multi_deps']

0 commit comments

Comments
 (0)