summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/unstructured-api-tools/default.nix
blob: 991a7986a8c0260ca921a4a811582634b2b3924f (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  # propagated build inputs
  click,
  fastapi,
  jinja2,
  mypy,
  nbconvert,
  python-multipart,
  pandas,
  types-requests,
  types-ujson,
  uvicorn,
  autoflake,
  # native check inputs
  pytestCheckHook,
  black,
  coverage,
  flake8,
  httpx,
  ipython,
  pytest-cov-stub,
  requests,
  requests-toolbelt,
  nbdev,
  pytest-mock,
}:
let
  version = "0.10.11";
in
buildPythonPackage {
  pname = "unstructured-api-tools";
  inherit version;
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "Unstructured-IO";
    repo = "unstructured-api-tools";
    tag = version;
    hash = "sha256-t1fK40ayR2bxc1iMIwvn/OHuyVlR98Gq+NpIhOmaP+4=";
  };

  propagatedBuildInputs = [
    click
    fastapi
    jinja2
    mypy
    nbconvert
    python-multipart
    pandas
    types-requests
    types-ujson
    uvicorn
    autoflake
  ]
  ++ uvicorn.optional-dependencies.standard;

  pythonImportsCheck = [ "unstructured_api_tools" ];

  # test require file generation but it complains about a missing file mypy
  doCheck = false;
  # preCheck = ''
  #   substituteInPlace Makefile \
  #     --replace "PYTHONPATH=." "" \
  #     --replace "mypy" "${mypy}/bin/mypy"
  #   make generate-test-api
  # '';

  nativeCheckInputs = [
    pytestCheckHook
    black
    coverage
    flake8
    httpx
    ipython
    pytest-cov-stub
    requests
    requests-toolbelt
    nbdev
    pytest-mock
  ];

  meta = {
    description = "";
    mainProgram = "unstructured_api_tools";
    homepage = "https://github.com/Unstructured-IO/unstructured-api-tools";
    changelog = "https://github.com/Unstructured-IO/unstructured-api-tools/blob/${version}/CHANGELOG.md";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ happysalada ];
  };
}