20 buildPythonPackage rec {
21 pname = "scikit-survival";
25 src = fetchFromGitHub {
27 repo = "scikit-survival";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-6902chXALa73/kTJ5UwV4CrB7/7wn+QXKpp2ej/Dnk8=";
37 propagatedBuildInputs = [
48 pythonImportsCheck = [ "sksurv" ];
50 nativeCheckInputs = [ pytestCheckHook ];
52 # can remove scikit-learn after 0.23.1
54 ln -s ${lib.getInclude eigen}/include/eigen3/Eigen \
55 sksurv/linear_model/src/eigen
56 sed -i -e 's/numpy>=2.0.0/numpy/' \
57 -e 's/scikit-learn~=1.4.0/scikit-learn/' pyproject.toml
60 # Hack needed to make pytest + cython work
61 # https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298
63 export HOME=$(mktemp -d)
64 cp -r $TMP/$sourceRoot/tests $HOME
69 # very long tests, unnecessary for a leaf package
74 "test_ensemble_selection"
80 ++ lib.optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)
81 # floating point mismatch on aarch64
82 # 27079905.88052468 to far from 27079905.880496684
86 description = "Survival analysis built on top of scikit-learn";
87 homepage = "https://github.com/sebp/scikit-survival";
88 license = licenses.gpl3Only;
89 maintainers = with maintainers; [ GuillaumeDesforges ];