summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/catboost/default.nix
blob: 5bb4e58d151e7f3b87a54afb8d6a545af88c1790 (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
{
  lib,
  buildPythonPackage,
  catboost,
  python,

  # build-system
  setuptools,

  # dependencies
  graphviz,
  matplotlib,
  numpy,
  pandas,
  plotly,
  scipy,
  six,
}:

buildPythonPackage rec {
  inherit (catboost)
    pname
    version
    src
    ;
  pyproject = true;

  sourceRoot = "${src.name}/catboost/python-package";

  build-system = [
    setuptools
  ];

  dependencies = [
    graphviz
    matplotlib
    numpy
    pandas
    plotly
    scipy
    six
  ];

  buildPhase = ''
    runHook preBuild

    # these arguments must set after bdist_wheel
    ${python.pythonOnBuildForHost.interpreter} setup.py bdist_wheel --no-widget --prebuilt-extensions-build-root-dir=${lib.getDev catboost}

    runHook postBuild
  '';

  # setup a test is difficult
  doCheck = false;

  pythonImportsCheck = [ "catboost" ];

  meta = catboost.meta // {
    # https://github.com/catboost/catboost/issues/2671
    broken = lib.versionAtLeast numpy.version "2";
  };
}