Skip to content

Commit 70e4828

Browse files
committed
rename ebpythonprefixes method and include found path in log info
1 parent 771ad84 commit 70e4828

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

easybuild/easyblocks/generic/pythonbundle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def make_module_extra(self, *args, **kwargs):
133133
# .pth files always should be in the site folder, so most of the path is fixed.
134134
# Try the installation directory first
135135
if self.installdir and search_file([self.installdir], r".*\.pth$", silent=True):
136-
self.log.info("Found path configuration file in installation directory. "
136+
self.log.info(f"Found path configuration file in installation directory '{self.installdir}'. "
137137
"Enabling $EBPYTHONPREFIXES...")
138138
use_ebpythonprefixes = True
139139

easybuild/easyblocks/generic/pythonpackage.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ def using_local_py_install_scheme(self):
617617
py_install_scheme = det_py_install_scheme(python_cmd=self.python_cmd)
618618
return py_install_scheme == PY_INSTALL_SCHEME_POSIX_LOCAL and self.using_pip_install()
619619

620-
def using_ebpythonprefixes(self) -> bool:
620+
def should_use_ebpythonprefixes(self) -> bool:
621621
"""
622622
Determine if we should update $EBPYTHONPREFIXES rather than $PYTHONPATH.
623623
If this Python package was installed for multiple Python versions, the package is using
@@ -644,15 +644,15 @@ def using_ebpythonprefixes(self) -> bool:
644644
# .pth files always should be in the site folder, so most of the path is fixed.
645645
# Try the installation directory first
646646
if self.installdir and search_file([self.installdir], r".*\.pth$", silent=True):
647-
self.log.info("Found path configuration file in installation directory. "
647+
self.log.info(f"Found path configuration file in installation directory '{self.installdir}'. "
648648
"Enabling $EBPYTHONPREFIXES...")
649649
use_ebpythonprefixes = True
650650
# If we did a test installation, check that one as well. Ensure that pypkg_test_installdir is set,
651651
# since that might not be the case for sanity_check_only or module_only.
652652
if self.testinstall and self.pypkg_test_installdir:
653653
if search_file([self.pypkg_test_installdir], r".*\.pth$", silent=True):
654-
self.log.info("Found path configuration file in test installation directory. "
655-
"Enabling $EBPYTHONPREFIXES...")
654+
self.log.info("Found path configuration file in test installation directory "
655+
f"'{self.pypkg_test_installdir}'. Enabling $EBPYTHONPREFIXES...")
656656
use_ebpythonprefixes = True
657657

658658
return self.multi_python or use_ebpythonprefixes
@@ -889,7 +889,7 @@ def test_step(self, return_output_ec=False):
889889
# add install location to both $PYTHONPATH and $PATH
890890
abs_pylibdirs = [os.path.join(actual_installdir, pylibdir) for pylibdir in self.all_pylibdirs]
891891
extrapath = "export PYTHONPATH=%s && " % os.pathsep.join(abs_pylibdirs + ['$PYTHONPATH'])
892-
if self.using_ebpythonprefixes():
892+
if self.should_use_ebpythonprefixes():
893893
extrapath += "export EBPYTHONPREFIXES=%s && " % os.pathsep.join([self.pypkg_test_installdir] +
894894
['$EBPYTHONPREFIXES'])
895895
extrapath += "export PATH=%s:$PATH && " % os.path.join(actual_installdir, 'bin')
@@ -1126,7 +1126,7 @@ def make_module_extra(self, *args, **kwargs):
11261126
"""Add install path to PYTHONPATH"""
11271127
txt = ''
11281128

1129-
if self.using_ebpythonprefixes():
1129+
if self.should_use_ebpythonprefixes():
11301130
path = '' # EBPYTHONPREFIXES are relative to the install dir
11311131
txt += self.module_generator.prepend_paths(EBPYTHONPREFIXES, path)
11321132
elif self.require_python:

0 commit comments

Comments
 (0)