diff --git a/var/spack/repos/builtin/packages/py-netcdf4/package.py b/var/spack/repos/builtin/packages/py-netcdf4/package.py index 22b92aa90640ca8eddc5570f478c82e5afb496cb..5c82e8bc02aef74df07718a88d27014f3feefd64 100644 --- a/var/spack/repos/builtin/packages/py-netcdf4/package.py +++ b/var/spack/repos/builtin/packages/py-netcdf4/package.py @@ -15,6 +15,7 @@ class PyNetcdf4(PythonPackage): license("MIT") + version("1.7.2", sha256="a4c6375540b19989896136943abb6d44850ff6f1fa7d3f063253b1ad3f8b7fce") version( "1.7.1.post2", sha256="37d557e36654889d7020192bfb56f9d5f93894cb32997eb837ae586c538fd7b6" ) @@ -27,6 +28,7 @@ class PyNetcdf4(PythonPackage): variant("mpi", default=True, description="Parallel IO support") depends_on("python", type=("build", "link", "run")) + depends_on("python@3.8:", when="@1.7.1:", type=("build", "link", "run")) depends_on("py-cython@0.29:", when="@1.6.5:", type="build") depends_on("py-cython@0.19:", type="build") depends_on("py-setuptools@61:", when="@1.6.5:", type="build") @@ -35,15 +37,17 @@ class PyNetcdf4(PythonPackage): depends_on("py-setuptools-scm@3.4:+toml", when="@1.7:", type="build") depends_on("py-cftime", type=("build", "run")) depends_on("py-certifi", when="@1.6.5:", type=("build", "run")) - depends_on("py-numpy", when="@1.6.5:", type=("build", "link", "run")) + depends_on("py-numpy", type=("build", "link", "run")) + depends_on("py-numpy@2.0:", when="@1.7.1:", type=("build", "link", "run")) depends_on("py-numpy@1.9:", when="@1.5.4:1.6.2", type=("build", "link", "run")) - depends_on("py-numpy@1.7:", type=("build", "link", "run")) # https://github.com/Unidata/netcdf4-python/pull/1317 depends_on("py-numpy@:1", when="@:1.6", type=("build", "link", "run")) depends_on("py-mpi4py", when="+mpi", type=("build", "run")) - depends_on("netcdf-c", when="-mpi") + # These forced variant requests are due to py-netcdf4 build scripts + # https://github.com/spack/spack/pull/47824#discussion_r1882473998 + depends_on("netcdf-c~mpi", when="~mpi") depends_on("netcdf-c+mpi", when="+mpi") - depends_on("hdf5@1.8.0:+hl", when="-mpi") + depends_on("hdf5@1.8.0:+hl~mpi", when="~mpi") depends_on("hdf5@1.8.0:+hl+mpi", when="+mpi") # The installation script tries to find hdf5 using pkg-config. However, the @@ -57,7 +61,7 @@ class PyNetcdf4(PythonPackage): patch( "https://github.com/Unidata/netcdf4-python/commit/49dcd0b5bd25824c254770c0d41445133fc13a46.patch?full_index=1", sha256="71eefe1d3065ad050fb72eb61d916ae1374a3fafd96ddaee6499cda952d992c4", - when="@1.6: %gcc@14:", + when="@1.6:1.6.5 %gcc@14:", ) def url_for_version(self, version):