1{ lib 2, buildPythonPackage 3, fetchPypi 4, cython 5, ecos 6, joblib 7, numexpr 8, numpy 9, osqp 10, pandas 11, scikit-learn 12, scipy 13, pytestCheckHook 14}: 15 16buildPythonPackage rec { 17 pname = "scikit-survival"; 18 version = "0.16.0"; 19 20 src = fetchPypi { 21 inherit pname version; 22 sha256 = "d3573eb1df9d516c75994a8a82108b6c7a5ca7ea8a9af60b38f3f65c3e227fa7"; 23 }; 24 25 nativeBuildInputs = [ 26 cython 27 ]; 28 29 propagatedBuildInputs = [ 30 ecos 31 joblib 32 numexpr 33 numpy 34 osqp 35 pandas 36 scikit-learn 37 scipy 38 ]; 39 40 pythonImportsCheck = [ "sksurv" ]; 41 42 checkInputs = [ pytestCheckHook ]; 43 44 # Hack needed to make pytest + cython work 45 # https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298 46 preCheck = '' 47 export HOME=$(mktemp -d) 48 cp -r $TMP/$sourceRoot/tests $HOME 49 pushd $HOME 50 ''; 51 postCheck = "popd"; 52 53 # very long tests, unnecessary for a leaf package 54 disabledTests = [ 55 "test_coxph" 56 "test_datasets" 57 "test_ensemble_selection" 58 "test_minlip" 59 "test_pandas_inputs" 60 "test_survival_svm" 61 "test_tree" 62 ]; 63 64 meta = with lib; { 65 description = "Survival analysis built on top of scikit-learn"; 66 homepage = "https://github.com/sebp/scikit-survival"; 67 license = licenses.gpl3Only; 68 maintainers = with maintainers; [ GuillaumeDesforges ]; 69 }; 70}