1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5# propagated build inputs
6, click
7, fastapi
8, jinja2
9, mypy
10, nbconvert
11, python-multipart
12, pandas
13, types-requests
14, types-ujson
15, uvicorn
16, autoflake
17# native check inputs
18, pytestCheckHook
19, black
20, coverage
21, flake8
22, httpx
23, ipython
24, pytest-cov
25, requests
26, requests-toolbelt
27, nbdev
28, pytest-mock
29}:
30let
31 version = "0.10.11";
32in
33buildPythonPackage {
34 pname = "unstructured-api-tools";
35 inherit version;
36 format = "setuptools";
37
38 disabled = pythonOlder "3.8";
39
40 src = fetchFromGitHub {
41 owner = "Unstructured-IO";
42 repo = "unstructured-api-tools";
43 rev = "refs/tags/${version}";
44 hash = "sha256-t1fK40ayR2bxc1iMIwvn/OHuyVlR98Gq+NpIhOmaP+4=";
45 };
46
47 propagatedBuildInputs = [
48 click
49 fastapi
50 jinja2
51 mypy
52 nbconvert
53 python-multipart
54 pandas
55 types-requests
56 types-ujson
57 uvicorn
58 autoflake
59 ] ++ uvicorn.optional-dependencies.standard;
60
61 pythonImportsCheck = [ "unstructured_api_tools" ];
62
63 # test require file generation but it complains about a missing file mypy
64 doCheck = false;
65 # preCheck = ''
66 # substituteInPlace Makefile \
67 # --replace "PYTHONPATH=." "" \
68 # --replace "mypy" "${mypy}/bin/mypy"
69 # make generate-test-api
70 # '';
71
72 nativeCheckInputs = [
73 pytestCheckHook
74 black
75 coverage
76 flake8
77 httpx
78 ipython
79 pytest-cov
80 requests
81 requests-toolbelt
82 nbdev
83 pytest-mock
84 ];
85
86 meta = with lib; {
87 description = "";
88 homepage = "https://github.com/Unstructured-IO/unstructured-api-tools";
89 changelog = "https://github.com/Unstructured-IO/unstructured-api-tools/blob/${version}/CHANGELOG.md";
90 license = licenses.asl20;
91 maintainers = with maintainers; [ happysalada ];
92 };
93}