easyblock = 'PythonPackage'

name = 'h5py'
version = '3.2.1'

homepage = 'https://www.h5py.org/'
description = """HDF5 for Python (h5py) is a general-purpose Python interface to the Hierarchical Data Format library,
 version 5. HDF5 is a versatile, mature scientific software library designed for the fast, flexible storage of enormous
 amounts of data."""

toolchain = {'name': 'intel', 'version': '2021a'}
toolchainopts = {'usempi': True}

sources = [SOURCE_TAR_GZ]
checksums = ['89474be911bfcdb34cbf0d98b8ec48b578c27a89fdb1ae4ee7513f1ef8d9249e']

builddependencies = [('pkgconfig', '1.5.4', '-python')]

dependencies = [
    ('Python', '3.9.5'),
    ('SciPy-bundle', '2021.05'),
    ('HDF5', '1.10.7'),
]

use_pip = True
sanity_pip_check = True
download_dep_fail = True

# h5py's setup.py will disable setup_requires if H5PY_SETUP_REQUIRES is set to 0
# without this environment variable, pip will fetch the minimum numpy version h5py supports during install,
# even though SciPy-bundle provides a newer version that satisfies h5py's install_requires dependency.
preinstallopts = 'HDF5_MPI=ON HDF5_DIR="$EBROOTHDF5" H5PY_SETUP_REQUIRES=0 '

moduleclass = 'data'
