From 80748d2789185a12416746b5b0caf1db65ffc1c6 Mon Sep 17 00:00:00 2001 From: Guillaume Desforges Date: Thu, 12 Mar 2020 15:06:06 +0100 Subject: [PATCH] scikit-survival: init at 0.11 --- .../scikit-survival/default.nix | 70 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 72 insertions(+) create mode 100644 pkgs/development/python-modules/scikit-survival/default.nix diff --git a/pkgs/development/python-modules/scikit-survival/default.nix b/pkgs/development/python-modules/scikit-survival/default.nix new file mode 100644 index 0000000000000..9e9d074e30da4 --- /dev/null +++ b/pkgs/development/python-modules/scikit-survival/default.nix @@ -0,0 +1,70 @@ +{ lib +, buildPythonPackage +, fetchPypi +, cython +, ecos +, joblib +, numexpr +, numpy +, osqp +, pandas +, scikitlearn +, scipy +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "scikit-survival"; + version = "0.15.0.post0"; + + src = fetchPypi { + inherit pname version; + sha256 = "572c3ac6818a9d0944fc4b8176eb948051654de857e28419ecc5060bcc6fbf37"; + }; + + nativeBuildInputs = [ + cython + ]; + + propagatedBuildInputs = [ + ecos + joblib + numexpr + numpy + osqp + pandas + scikitlearn + scipy + ]; + + pythonImportsCheck = [ "sksurv" ]; + + checkInputs = [ pytestCheckHook ]; + + # Hack needed to make pytest + cython work + # https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298 + preCheck = '' + export HOME=$(mktemp -d) + cp -r $TMP/$sourceRoot/tests $HOME + pushd $HOME + ''; + postCheck = "popd"; + + # very long tests, unnecessary for a leaf package + disabledTests = [ + "test_coxph" + "test_datasets" + "test_ensemble_selection" + "test_minlip" + "test_pandas_inputs" + "test_survival_svm" + "test_tree" + ]; + + meta = with lib; { + description = "Survival analysis built on top of scikit-learn"; + homepage = "https://github.com/sebp/scikit-survival"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ GuillaumeDesforges ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index edeb7ffb3d00b..c2e5d634968fa 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7265,6 +7265,8 @@ in { scripttest = callPackage ../development/python-modules/scripttest { }; + scikit-survival = callPackage ../development/python-modules/scikit-survival { }; + scs = callPackage ../development/python-modules/scs { scs = pkgs.scs; }; sdnotify = callPackage ../development/python-modules/sdnotify { };