about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/unstructured-api-tools/default.nix
blob: b3c904ba2f2452df0f3da60f053c2d1ee2ee02db (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
84
85
86
87
88
89
90
91
92
93
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
# 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
, requests
, requests-toolbelt
, nbdev
, pytest-mock
}:
let
  version = "0.10.11";
in
buildPythonPackage {
  pname = "unstructured-api-tools";
  inherit version;
  format = "setuptools";

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "Unstructured-IO";
    repo = "unstructured-api-tools";
    rev = "refs/tags/${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
    requests
    requests-toolbelt
    nbdev
    pytest-mock
  ];

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