From f213cf834937fc52518edbd16a82870efaba8b4c Mon Sep 17 00:00:00 2001 From: Bryan Herman <63422190+bryanherman@users.noreply.github.com> Date: Fri, 12 Mar 2021 14:44:37 -0500 Subject: py-h5py: offline installation and deps fix (#22262) * added h5py patch file for offline installs to work * h5py v3+ deps consistent with setup.py, add patch --- .../packages/py-h5py/h5py-3-setuprequires.patch | 21 +++++++++++++++++++++ var/spack/repos/builtin/packages/py-h5py/package.py | 20 +++++++++++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 var/spack/repos/builtin/packages/py-h5py/h5py-3-setuprequires.patch diff --git a/var/spack/repos/builtin/packages/py-h5py/h5py-3-setuprequires.patch b/var/spack/repos/builtin/packages/py-h5py/h5py-3-setuprequires.patch new file mode 100644 index 0000000000..c8c6654736 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-h5py/h5py-3-setuprequires.patch @@ -0,0 +1,21 @@ +diff -Naur h5py-3.1.0/setup.py h5py-3.1.0.patch/setup.py +--- h5py-3.1.0/setup.py 2020-11-06 14:25:11.000000000 +0000 ++++ h5py-3.1.0.patch/setup.py 2021-03-04 20:12:19.913405154 +0000 +@@ -49,14 +49,14 @@ + f"Cython >=0.29; python_version<'3.8'", + f"Cython >=0.29.14; python_version>='3.8'", + ] + [ +- f"numpy =={np_min}; python_version{py_condition}" ++ f"numpy >={np_min}; python_version{py_condition}" + for np_min, py_condition in NUMPY_MIN_VERSIONS + ] + + if setup_configure.mpi_enabled(): + RUN_REQUIRES.append('mpi4py >=3.0.0') +- SETUP_REQUIRES.append("mpi4py ==3.0.0; python_version<'3.8'") +- SETUP_REQUIRES.append("mpi4py ==3.0.3; python_version>='3.8'") ++ SETUP_REQUIRES.append("mpi4py >=3.0.0; python_version<'3.8'") ++ SETUP_REQUIRES.append("mpi4py >=3.0.3; python_version>='3.8'") + + # Set the environment variable H5PY_SETUP_REQUIRES=0 if we need to skip + # setup_requires for any reason. diff --git a/var/spack/repos/builtin/packages/py-h5py/package.py b/var/spack/repos/builtin/packages/py-h5py/package.py index 36a1d5e952..da9596756a 100644 --- a/var/spack/repos/builtin/packages/py-h5py/package.py +++ b/var/spack/repos/builtin/packages/py-h5py/package.py @@ -36,15 +36,20 @@ class PyH5py(PythonPackage): # Build dependencies depends_on('py-cython@0.23:', type='build', when='@:2.99') - depends_on('py-cython@0.29:', type=('build'), when='@3.0.0:') + depends_on('py-cython@0.29:', type=('build'), when='@3.0.0:^python@:3.7.99') + depends_on('py-cython@0.29.14:', type=('build'), when='@3.0.0:^python@3.8.0:3.8.99') + depends_on('py-cython@0.29.15:', type=('build'), when='@3.0.0:^python@3.9.0:') depends_on('py-pkgconfig', type='build') depends_on('py-setuptools', type='build') depends_on('py-wheel', type='build', when='@3.0.0:') # Build and runtime dependencies - depends_on('py-cached-property@1.5:', type=('build', 'run'), when='python@:3.7.999') - depends_on('py-numpy@1.7:', type=('build', 'run'), when='@:3.1.99') - depends_on('py-numpy@1.14.5:', type=('build', 'run'), when='@3.2.0:') + depends_on('py-cached-property@1.5:', type=('build', 'run'), when='^python@:3.7.99') + depends_on('py-numpy@1.7:', type=('build', 'run'), when='@:2.99') + depends_on('py-numpy@1.12:', type=('build', 'run'), when='@3.0.0:^python@3.6.0:3.6.99') + depends_on('py-numpy@1.14.5:', type=('build', 'run'), when='@3.0.0:^python@3.7.0:3.7.99') + depends_on('py-numpy@1.17.5:', type=('build', 'run'), when='@3.0.0:^python@3.8.0:3.8.99') + depends_on('py-numpy@1.19.3:', type=('build', 'run'), when='@3.0.0:^python@3.9.0:') depends_on('py-six', type=('build', 'run'), when='@:2.99') # Link dependencies @@ -56,7 +61,12 @@ class PyH5py(PythonPackage): depends_on('hdf5~mpi', when='~mpi') depends_on('mpi', when='+mpi') depends_on('py-mpi4py', when='@:2.99 +mpi', type=('build', 'run')) - depends_on('py-mpi4py@3.0.0:', when='@3.0.0: +mpi', type=('build', 'run')) + depends_on('py-mpi4py@3.0.0:', when='@3.0.0:+mpi^python@3.0.0:3.7.99', type=('build', 'run')) + depends_on('py-mpi4py@3.0.3:', when='@3.0.0:+mpi^python@3.8.0:', type=('build', 'run')) + + # For version 3+, patch setup.py to allow setup_requires list to be more abstract. + # Required for offline installations with version 3+ + patch('h5py-3-setuprequires.patch', when="@3.0.0:") phases = ['configure', 'install'] -- cgit v1.2.3-60-g2f50