1{ 2 lib, 3 fetchFromGitHub, 4 buildPythonPackage, 5 numpy, 6 cython, 7 scipy, 8 scikit-learn, 9 matplotlib, 10 pytestCheckHook, 11}: 12 13buildPythonPackage rec { 14 pname = "scikit-learn-extra"; 15 version = "0.3.0"; 16 format = "setuptools"; 17 18 src = fetchFromGitHub { 19 owner = "scikit-learn-contrib"; 20 repo = "scikit-learn-extra"; 21 tag = "v${version}"; 22 sha256 = "sha256-dHOwo6NIuhcvIehpuJQ621JEg5O3mnXycAhpTZKaxns="; 23 }; 24 25 nativeBuildInputs = [ 26 numpy 27 cython 28 ]; 29 propagatedBuildInputs = [ 30 numpy 31 scipy 32 scikit-learn 33 ]; 34 nativeCheckInputs = [ 35 matplotlib 36 pytestCheckHook 37 ]; 38 39 preCheck = '' 40 # Remove the package in the build dir, because Python defaults to it and 41 # ignores the one in Nix store with cythonized modules. 42 rm -r sklearn_extra 43 ''; 44 45 pytestFlags = [ 46 "--pyargs" 47 "sklearn_extra" 48 ]; 49 disabledTestPaths = [ 50 "benchmarks" 51 "examples" 52 "doc" 53 ]; 54 disabledTests = [ 55 "build" # needs network connection 56 "test_all_estimators" # sklearn.exceptions.NotFittedError: Estimator fails to pass `check_is_fitted` even though it has been fit. 57 ]; 58 59 # Check packages with cythonized modules 60 pythonImportsCheck = [ 61 "sklearn_extra" 62 "sklearn_extra.cluster" 63 "sklearn_extra.robust" 64 "sklearn_extra.utils" 65 ]; 66 67 meta = { 68 description = "Set of tools for scikit-learn"; 69 homepage = "https://github.com/scikit-learn-contrib/scikit-learn-extra"; 70 license = lib.licenses.bsd3; 71 maintainers = with lib.maintainers; [ yl3dy ]; 72 }; 73}