diff --git a/pkgs/development/python-modules/cftime/default.nix b/pkgs/development/python-modules/cftime/default.nix index 865282cfa650..c925381d00f1 100644 --- a/pkgs/development/python-modules/cftime/default.nix +++ b/pkgs/development/python-modules/cftime/default.nix @@ -2,6 +2,7 @@ , buildPythonPackage , cython , fetchPypi +, fetchpatch , numpy , pytestCheckHook , pythonOlder @@ -16,9 +17,22 @@ buildPythonPackage rec { src = fetchPypi { inherit pname version; - sha256 = "sha256-hhTAD7ilBG3jBP3Ybb0iT5lAgYXXskWsZijQJ2WW5tI="; + hash = "sha256-hhTAD7ilBG3jBP3Ybb0iT5lAgYXXskWsZijQJ2WW5tI="; }; + patches = [ + (fetchpatch { + # Fix test_num2date_precision by checking per platform precision + url = "https://github.com/Unidata/cftime/commit/221ff2195d588a43a7984597033b678f330fbc41.patch"; + hash = "sha256-3XTJuET20g9QElM/8WGnNzJBFZ0oUN4ikhWKppwcyNM="; + }) + ]; + + postPatch = '' + sed -i "/--cov/d" setup.cfg + ''; + + nativeBuildInputs = [ cython numpy @@ -32,10 +46,6 @@ buildPythonPackage rec { pytestCheckHook ]; - postPatch = '' - sed -i "/--cov/d" setup.cfg - ''; - pythonImportsCheck = [ "cftime" ];