about summary refs log tree commit diff
path: root/pkgs/development/python-modules/dataprep-ml/default.nix
blob: df952df2bd0a62ed39ff3dec06bebba9dc7dfb39 (plain) (blame)
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
76
77
78
79
80
81
82
83
{
  lib,
  buildPythonPackage,
  colorlog,
  dataclasses-json,
  fetchPypi,
  nltk-data,
  numpy,
  pandas,
  poetry-core,
  pydantic,
  pydateinfer,
  python-dateutil,
  pythonOlder,
  scipy,
  symlinkJoin,
  type-infer,
}:
let
  testNltkData = symlinkJoin {
    name = "nltk-test-data";
    paths = [
      nltk-data.punkt
      nltk-data.stopwords
    ];
  };
in
buildPythonPackage rec {
  pname = "dataprep-ml";
  version = "24.5.1.2";
  pyproject = true;

  disabled = pythonOlder "3.8";

  # using PyPI as github repo does not contain tags or release branches
  src = fetchPypi {
    pname = "dataprep_ml";
    inherit version;
    hash = "sha256-pZhHlNcQJLBww7ur2Z6Yb2IdbRsBtjzQAzfa4UzGKt4=";
  };

  pythonRelaxDeps = [ "pydantic" ];

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    colorlog
    dataclasses-json
    numpy
    pandas
    pydantic
    pydateinfer
    python-dateutil
    scipy
    type-infer
  ];

  # PyPI tarball has no tests
  doCheck = false;

  # Package import requires NLTK data to be downloaded
  # It is the only way to set NLTK_DATA environment variable,
  # so that it is available in pythonImportsCheck
  env.NLTK_DATA = testNltkData;
  pythonImportsCheck = [
    "dataprep_ml"
    "dataprep_ml.cleaners"
    "dataprep_ml.helpers"
    "dataprep_ml.imputers"
    "dataprep_ml.insights"
    "dataprep_ml.recommenders"
    "dataprep_ml.splitters"
  ];

  meta = with lib; {
    description = "Data utilities for Machine Learning pipelines";
    homepage = "https://github.com/mindsdb/dataprep_ml";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ mbalatsko ];
  };
}