portfolio: 0.71.2 -> 0.72.2 (#360387)
[NixPkgs.git] / pkgs / development / python-modules / unstructured-inference / default.nix
blobcf51d6bdf9732b2c3d811dfa46bc7e730298fb55
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   # runtime dependencies
6   layoutparser,
7   python-multipart,
8   huggingface-hub,
9   opencv-python,
10   onnxruntime,
11   transformers,
12   detectron2,
13   paddleocr,
14   # check inputs
15   pytestCheckHook,
16   coverage,
17   click,
18   httpx,
19   mypy,
20   pytest-cov-stub,
21   pdf2image,
24 buildPythonPackage rec {
25   pname = "unstructured-inference";
26   version = "0.7.37";
27   format = "setuptools";
29   src = fetchFromGitHub {
30     owner = "Unstructured-IO";
31     repo = "unstructured-inference";
32     rev = "refs/tags/${version}";
33     hash = "sha256-2k7gFlBUevVnz2A5pvUE4eIGmXwEr5s4F8BbX6j5lzc=";
34   };
36   propagatedBuildInputs =
37     [
38       layoutparser
39       python-multipart
40       huggingface-hub
41       opencv-python
42       onnxruntime
43       transformers
44       detectron2
45       paddleocr
46       # yolox
47     ]
48     ++ layoutparser.optional-dependencies.layoutmodels ++ layoutparser.optional-dependencies.tesseract;
50   nativeCheckInputs = [
51     pytestCheckHook
52     coverage
53     click
54     httpx
55     mypy
56     pytest-cov-stub
57     pdf2image
58     huggingface-hub
59   ];
61   preCheck = ''
62     export HOME=$(mktemp -d)
63   '';
65   disabledTests = [
66     # not sure why this fails
67     "test_get_path_oob_move_deeply_nested"
68     "test_get_path_oob_move_nested[False]"
69     # requires yolox
70     "test_yolox"
71   ];
73   disabledTestPaths = [
74     # network access
75     "test_unstructured_inference/inference/test_layout.py"
76     "test_unstructured_inference/models/test_chippermodel.py"
77     "test_unstructured_inference/models/test_detectron2.py"
78     "test_unstructured_inference/models/test_detectron2onnx.py"
79     # unclear failure
80     "test_unstructured_inference/models/test_donut.py"
81     "test_unstructured_inference/models/test_model.py"
82     "test_unstructured_inference/models/test_tables.py"
83   ];
85   pythonImportsCheck = [ "unstructured_inference" ];
87   meta = with lib; {
88     description = "hosted model inference code for layout parsing models";
89     homepage = "https://github.com/Unstructured-IO/unstructured-inference";
90     changelog = "https://github.com/Unstructured-IO/unstructured-inference/blob/${src.rev}/CHANGELOG.md";
91     license = licenses.asl20;
92     maintainers = with maintainers; [ happysalada ];
93     platforms = [
94       "x86_64-linux"
95       "x86_64-darwin"
96       "aarch64-darwin"
97     ];
98   };