summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/scikit-learn-extra/default.nix
blob: 3f5f9b9902656488bbe8bb7706e7fb616fe10c27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
  lib,
  fetchFromGitHub,
  buildPythonPackage,
  numpy,
  cython,
  scipy,
  scikit-learn,
  matplotlib,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "scikit-learn-extra";
  version = "0.3.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "scikit-learn-contrib";
    repo = "scikit-learn-extra";
    tag = "v${version}";
    sha256 = "sha256-dHOwo6NIuhcvIehpuJQ621JEg5O3mnXycAhpTZKaxns=";
  };

  nativeBuildInputs = [
    numpy
    cython
  ];
  propagatedBuildInputs = [
    numpy
    scipy
    scikit-learn
  ];
  nativeCheckInputs = [
    matplotlib
    pytestCheckHook
  ];

  preCheck = ''
    # Remove the package in the build dir, because Python defaults to it and
    # ignores the one in Nix store with cythonized modules.
    rm -r sklearn_extra
  '';

  pytestFlags = [
    "--pyargs"
    "sklearn_extra"
  ];
  disabledTestPaths = [
    "benchmarks"
    "examples"
    "doc"
  ];
  disabledTests = [
    "build" # needs network connection
    "test_all_estimators" # sklearn.exceptions.NotFittedError: Estimator fails to pass `check_is_fitted` even though it has been fit.
  ];

  # Check packages with cythonized modules
  pythonImportsCheck = [
    "sklearn_extra"
    "sklearn_extra.cluster"
    "sklearn_extra.robust"
    "sklearn_extra.utils"
  ];

  meta = {
    # Marked broken 2025-11-28 because it has failed on Hydra for at least one year.
    broken = true;
    description = "Set of tools for scikit-learn";
    homepage = "https://github.com/scikit-learn-contrib/scikit-learn-extra";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ yl3dy ];
  };
}