Skip to content

Commit b369d8b

Browse files
authored
py-netcdf4: add v1.7.2 and fix variant (spack#47824)
1 parent 4d2319a commit b369d8b

File tree

1 file changed

+9
-5
lines changed
  • var/spack/repos/builtin/packages/py-netcdf4

1 file changed

+9
-5
lines changed

var/spack/repos/builtin/packages/py-netcdf4/package.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class PyNetcdf4(PythonPackage):
1515

1616
license("MIT")
1717

18+
version("1.7.2", sha256="a4c6375540b19989896136943abb6d44850ff6f1fa7d3f063253b1ad3f8b7fce")
1819
version(
1920
"1.7.1.post2", sha256="37d557e36654889d7020192bfb56f9d5f93894cb32997eb837ae586c538fd7b6"
2021
)
@@ -27,6 +28,7 @@ class PyNetcdf4(PythonPackage):
2728
variant("mpi", default=True, description="Parallel IO support")
2829

2930
depends_on("python", type=("build", "link", "run"))
31+
depends_on("[email protected]:", when="@1.7.1:", type=("build", "link", "run"))
3032
depends_on("[email protected]:", when="@1.6.5:", type="build")
3133
depends_on("[email protected]:", type="build")
3234
depends_on("py-setuptools@61:", when="@1.6.5:", type="build")
@@ -35,15 +37,17 @@ class PyNetcdf4(PythonPackage):
3537
depends_on("[email protected]:+toml", when="@1.7:", type="build")
3638
depends_on("py-cftime", type=("build", "run"))
3739
depends_on("py-certifi", when="@1.6.5:", type=("build", "run"))
38-
depends_on("py-numpy", when="@1.6.5:", type=("build", "link", "run"))
40+
depends_on("py-numpy", type=("build", "link", "run"))
41+
depends_on("[email protected]:", when="@1.7.1:", type=("build", "link", "run"))
3942
depends_on("[email protected]:", when="@1.5.4:1.6.2", type=("build", "link", "run"))
40-
depends_on("[email protected]:", type=("build", "link", "run"))
4143
# https://github.com/Unidata/netcdf4-python/pull/1317
4244
depends_on("py-numpy@:1", when="@:1.6", type=("build", "link", "run"))
4345
depends_on("py-mpi4py", when="+mpi", type=("build", "run"))
44-
depends_on("netcdf-c", when="-mpi")
46+
# These forced variant requests are due to py-netcdf4 build scripts
47+
# https://github.com/spack/spack/pull/47824#discussion_r1882473998
48+
depends_on("netcdf-c~mpi", when="~mpi")
4549
depends_on("netcdf-c+mpi", when="+mpi")
46-
depends_on("[email protected]:+hl", when="-mpi")
50+
depends_on("[email protected]:+hl~mpi", when="~mpi")
4751
depends_on("[email protected]:+hl+mpi", when="+mpi")
4852

4953
# The installation script tries to find hdf5 using pkg-config. However, the
@@ -57,7 +61,7 @@ class PyNetcdf4(PythonPackage):
5761
patch(
5862
"https://github.com/Unidata/netcdf4-python/commit/49dcd0b5bd25824c254770c0d41445133fc13a46.patch?full_index=1",
5963
sha256="71eefe1d3065ad050fb72eb61d916ae1374a3fafd96ddaee6499cda952d992c4",
60-
when="@1.6: %gcc@14:",
64+
when="@1.6:1.6.5 %gcc@14:",
6165
)
6266

6367
def url_for_version(self, version):

0 commit comments

Comments
 (0)