From a8f9a8d18febe4179defb145a7d426f4051e7694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 14 Dec 2024 12:28:50 -0800 Subject: [PATCH] python312Packages.netcdf4: 1.7.1.post2 -> 1.7.2 Diff: https://github.com/Unidata/netcdf4-python/compare/v1.7.1.post2...v1.7.2rel Changelog: https://github.com/Unidata/netcdf4-python/raw/v1.7.2rel/Changelog --- .../python-modules/netcdf4/default.nix | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/netcdf4/default.nix b/pkgs/development/python-modules/netcdf4/default.nix index 056949ef2f97..1ce4ac8c01f3 100644 --- a/pkgs/development/python-modules/netcdf4/default.nix +++ b/pkgs/development/python-modules/netcdf4/default.nix @@ -5,7 +5,7 @@ cftime, curl, cython, - fetchPypi, + fetchFromGitHub, hdf5, isPyPy, libjpeg, @@ -20,16 +20,23 @@ zlib, }: -buildPythonPackage rec { +let + version = "1.7.2"; + suffix = lib.optionalString (lib.match ''.*\.post[0-9]+'' version == null) "rel"; + tag = "v${version}${suffix}"; +in +buildPythonPackage { pname = "netcdf4"; - version = "1.7.1.post2"; + inherit version; pyproject = true; disabled = isPyPy || pythonOlder "3.8"; - src = fetchPypi { - inherit pname version; - hash = "sha256-N9VX42ZUiJ1wIBkr+1b51fk4lMsymX64N65YbFOP17Y="; + src = fetchFromGitHub { + owner = "Unidata"; + repo = "netcdf4-python"; + inherit tag; + hash = "sha256-orwCHKOSam+2eRY/yAduFYWREOkJlWIJGIZPZwQZ/RI="; }; postPatch = '' @@ -43,20 +50,27 @@ buildPythonPackage rec { wheel ]; - propagatedBuildInputs = [ + dependencies = [ certifi cftime + numpy + ]; + + buildInputs = [ curl hdf5 libjpeg netcdf - numpy zlib ]; checkPhase = '' + runHook preCheck + pushd test/ NO_NET=1 NO_CDL=1 ${python.interpreter} run_all.py + + runHook postCheck ''; env = { @@ -73,7 +87,7 @@ buildPythonPackage rec { meta = with lib; { description = "Interface to netCDF library (versions 3 and 4)"; homepage = "https://github.com/Unidata/netcdf4-python"; - changelog = "https://github.com/Unidata/netcdf4-python/raw/v${version}/Changelog"; + changelog = "https://github.com/Unidata/netcdf4-python/raw/${tag}/Changelog"; maintainers = [ ]; license = licenses.mit; };