nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
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-stub,
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 src = fetchFromGitHub {
39 owner = "Unstructured-IO";
40 repo = "unstructured-api-tools";
41 tag = version;
42 hash = "sha256-t1fK40ayR2bxc1iMIwvn/OHuyVlR98Gq+NpIhOmaP+4=";
43 };
44
45 propagatedBuildInputs = [
46 click
47 fastapi
48 jinja2
49 mypy
50 nbconvert
51 python-multipart
52 pandas
53 types-requests
54 types-ujson
55 uvicorn
56 autoflake
57 ]
58 ++ uvicorn.optional-dependencies.standard;
59
60 pythonImportsCheck = [ "unstructured_api_tools" ];
61
62 # test require file generation but it complains about a missing file mypy
63 doCheck = false;
64 # preCheck = ''
65 # substituteInPlace Makefile \
66 # --replace "PYTHONPATH=." "" \
67 # --replace "mypy" "${mypy}/bin/mypy"
68 # make generate-test-api
69 # '';
70
71 nativeCheckInputs = [
72 pytestCheckHook
73 black
74 coverage
75 flake8
76 httpx
77 ipython
78 pytest-cov-stub
79 requests
80 requests-toolbelt
81 nbdev
82 pytest-mock
83 ];
84
85 meta = {
86 description = "";
87 mainProgram = "unstructured_api_tools";
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 = lib.licenses.asl20;
91 maintainers = with lib.maintainers; [ happysalada ];
92 };
93}