about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/type-infer/default.nix
blob: 55af22a1c94b5418f9355b28e1fcdbe5d3b403bf (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
{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
, poetry-core
, colorlog
, dataclasses-json
, langid
, nltk
, numpy
, pandas
, psutil
, python-dateutil
, scipy
, toml
, nltk-data
, symlinkJoin
}:
let
  testNltkData = symlinkJoin {
    name = "nltk-test-data";
    paths = [ nltk-data.punkt nltk-data.stopwords ];
  };
in
buildPythonPackage rec {
  pname = "type-infer";
  version = "0.0.18";
  format = "pyproject";

  disabled = pythonOlder "3.8";

  # using PyPI because the repo does not have tags or release branches
  src = fetchPypi {
    pname = "type_infer";
    inherit version;
    hash = "sha256-nA5TlyHpCueFWqUggS7T/eKSLlffp0pIyGCouwXPZ28=";
  };

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    colorlog
    dataclasses-json
    langid
    nltk
    numpy
    pandas
    psutil
    python-dateutil
    scipy
    toml
  ];

  # PyPI package does not include 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 = [ "type_infer" ];

  meta = with lib; {
    description = "Automated type inference for Machine Learning pipelines";
    homepage = "https://pypi.org/project/type-infer/";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ mbalatsko ];
  };
}