Skip to content

Commit

Permalink
Add more reliable way to detect Python dep
Browse files Browse the repository at this point in the history
  • Loading branch information
Micket committed Aug 15, 2024
1 parent 75c6c28 commit 2ed73d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions easybuild/easyblocks/generic/pythonbundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ def make_module_extra(self, *args, **kwargs):
# update $EBPYTHONPREFIXES rather than $PYTHONPATH
# if this Python package was installed for multiple Python versions
# or if we prefer it
use_ebpythonprefixes = get_software_root('Python') and build_option('prefer_ebpythonprefixes') and \
self.cfg['prefer_ebpythonprefixes']
runtime_deps = [dep['name'] for dep in self.cfg.dependencies(runtime_only=True)]
use_ebpythonprefixes = 'Python' in runtime_deps and \
build_option('prefer_ebpythonprefixes') and self.cfg['prefer_ebpythonprefixes']
if self.multi_python or use_ebpythonprefixes:
if EBPYTHONPREFIXES not in self.module_generator.added_paths_per_key:
txt += self.module_generator.prepend_paths(EBPYTHONPREFIXES, '')
Expand Down
6 changes: 3 additions & 3 deletions easybuild/easyblocks/generic/pythonpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,9 @@ def make_module_extra(self, *args, **kwargs):
# update $EBPYTHONPREFIXES rather than $PYTHONPATH
# if this Python package was installed for multiple Python versions
# or if we prefer it

use_ebpythonprefixes = get_software_root('Python') and build_option('prefer_ebpythonprefixes') and \
self.cfg['prefer_ebpythonprefixes']
runtime_deps = [dep['name'] for dep in self.cfg.dependencies(runtime_only=True)]
use_ebpythonprefixes = 'Python' in runtime_deps and \
build_option('prefer_ebpythonprefixes') and self.cfg['prefer_ebpythonprefixes']
if self.multi_python or use_ebpythonprefixes:
txt += self.module_generator.prepend_paths(EBPYTHONPREFIXES, '')
elif self.require_python:
Expand Down

0 comments on commit 2ed73d5

Please sign in to comment.