From 20e41e0acdbec96be488163ac48247e218fb313d Mon Sep 17 00:00:00 2001 From: Rob <86313040+robert-manchester@users.noreply.github.com> Date: Tue, 7 Nov 2023 00:12:16 -0800 Subject: [PATCH] python311Packages.scikit-survival: 0.21.0 -> 0.22.1; fix build disable test_coxnet on darwin aarch64 due to 2e-05 floating point mismatch --- .../python-modules/scikit-survival/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/scikit-survival/default.nix b/pkgs/development/python-modules/scikit-survival/default.nix index b2c4218e5f33a..9a766cedece31 100644 --- a/pkgs/development/python-modules/scikit-survival/default.nix +++ b/pkgs/development/python-modules/scikit-survival/default.nix @@ -17,12 +17,12 @@ buildPythonPackage rec { pname = "scikit-survival"; - version = "0.21.0"; - format = "setuptools"; + version = "0.22.1"; + pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-rcdEtlmD3O2BQuwxRlOJ/HOEBdWJBRJR5UR6rZoeArw="; + hash = "sha256-Ft0Hg5iF9Sb9VSOsFMgfAvc4Nsam216kzt5Xv2iykv8="; }; nativeBuildInputs = [ @@ -45,6 +45,11 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; + # treat numpy versions as lower bounds, same as setuptools build + postPatch = '' + sed -i 's/numpy==/numpy>=/' pyproject.toml + ''; + # Hack needed to make pytest + cython work # https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298 preCheck = '' @@ -63,10 +68,13 @@ buildPythonPackage rec { "test_pandas_inputs" "test_survival_svm" "test_tree" - ]; + ] ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) + # floating point mismatch on aarch64 + # 27079905.88052468 to far from 27079905.880496684 + "test_coxnet" + ; meta = with lib; { - broken = (stdenv.isLinux && stdenv.isAarch64); description = "Survival analysis built on top of scikit-learn"; homepage = "https://github.com/sebp/scikit-survival"; license = licenses.gpl3Only;