1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, numpy
5, cython
6, scipy
7, scikit-learn
8, matplotlib
9, pytestCheckHook
10}:
11
12buildPythonPackage rec {
13 pname = "scikit-learn-extra";
14 version = "0.2.0";
15
16 src = fetchFromGitHub {
17 owner = "scikit-learn-contrib";
18 repo = pname;
19 rev = "v${version}";
20 sha256 = "09v7a9jdycdrlqq349m1gbn8ppzv1bl5g3l72k6ywsx2xb01qw13";
21 };
22
23 nativeBuildInputs = [ numpy cython ];
24 propagatedBuildInputs = [ numpy scipy scikit-learn ];
25 checkInputs = [ matplotlib pytestCheckHook ];
26
27 preCheck = ''
28 # Remove the package in the build dir, because Python defaults to it and
29 # ignores the one in Nix store with cythonized modules.
30 rm -r sklearn_extra
31 '';
32
33 pytestFlagsArray = [ "--pyargs sklearn_extra" ];
34 disabledTestPaths = [
35 "benchmarks"
36 "examples"
37 "doc"
38 ];
39 disabledTests = [
40 "build" # needs network connection
41 ];
42
43 # Check packages with cythonized modules
44 pythonImportsCheck = [
45 "sklearn_extra"
46 "sklearn_extra.cluster"
47 "sklearn_extra.robust"
48 "sklearn_extra.utils"
49 ];
50
51 meta = {
52 description = "A set of tools for scikit-learn";
53 homepage = "https://github.com/scikit-learn-contrib/scikit-learn-extra";
54 license = lib.licenses.bsd3;
55 maintainers = with lib.maintainers; [ yl3dy ];
56 };
57}