Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions easybuild/easyblocks/s/scipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
from easybuild.easyblocks.generic.mesonninja import MesonNinja
from easybuild.easyblocks.generic.pythonpackage import PythonPackage, det_pylibdir
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import change_dir, copy_dir
from easybuild.tools.build_log import EasyBuildError, print_warning
from easybuild.tools.filetools import change_dir, copy_dir, copy_file


class EB_scipy(FortranPythonPackage, PythonPackage, MesonNinja):
Expand Down Expand Up @@ -198,6 +198,18 @@ def install_step(self):
"""Custom install step for scipy: use ninja for scipy >= 1.9.0"""
if self.use_meson:
MesonNinja.install_step(self)

# copy PKG-INFO file included in scipy source tarball to scipy-<version>.egg-info in installation,
# so pip is aware of the scipy installation (required for 'pip list', 'pip check', etc.);
# see also https://github.com/easybuilders/easybuild-easyblocks/issues/2901
pkg_info = os.path.join(self.cfg['start_dir'], 'PKG-INFO')
target_egg_info = os.path.join(self.installdir, self.pylibdir, 'scipy-%s.egg-info' % self.version)
if os.path.isfile(pkg_info):
copy_file(pkg_info, target_egg_info)
else:
cwd = os.getcwd()
print_warning("%s not found in %s, so can't use it to create %s!", pkg_info, cwd, target_egg_info,
log=self.log)
else:
FortranPythonPackage.install_step(self)

Expand All @@ -211,4 +223,9 @@ def sanity_check_step(self, *args, **kwargs):
'dirs': [det_pylibdir()],
}

return PythonPackage.sanity_check_step(self, custom_paths=custom_paths)
# make sure that scipy is included in output of 'pip list',
# so that 'pip check' passes if scipy is a required dependency for another Python package;
# use case-insensitive match, since name is sometimes reported as 'SciPy'
custom_commands = [r"pip list | grep -iE '^scipy\s+%s\s*$'" % self.version.replace('.', r'\.')]

return PythonPackage.sanity_check_step(self, custom_paths=custom_paths, custom_commands=custom_commands)