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
This commit is contained in:
Bryan Herman 2021-03-12 14:44:37 -05:00 committed by GitHub
parent 474e616a5b
commit f213cf8349
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 5 deletions

View File

@ -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.

View File

@ -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']