forked from xberg-io/xberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
109 lines (105 loc) · 4.27 KB
/
Copy pathpyproject.toml
File metadata and controls
109 lines (105 loc) · 4.27 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
[build-system]
build-backend = "maturin"
requires = ["maturin>=1.13.1,<2"]
[dependency-groups]
dev = [
"covdefaults>=2.3.0",
"httpx>=0.28.1",
"maturin>=1.13.1",
"pytest>=9.0.3",
"pytest-asyncio>=1.3.0",
"pytest-cov>=7.1.0",
"pytest-mock>=3.15.1",
"pytest-rerunfailures>=16.2",
"pytest-timeout>=2.4.0",
"ruff==0.16.4",
"types-pillow>=10.2",
"types-psutil>=7.2.2.20260508",
"validate-pyproject>=0.24.1",
]
# docling-jobkit drives the batch path (in-process converter manager) and pulls
# docling-slim>=2.117.0, which also serves the single-file path via the `docling` namespace.
# docling-slim ships no OCR engine; EasyOCR is docling's default OCR backend and is
# required by the OCR cohorts (and the EasyOCR model-prefetch step), so add it explicitly.
#
# 3.5.0 is a floor, not a preference. docling's default `pdf_backend` became
# `THREADED_DOCLING_PARSE`, but jobkit 3.2.0's converter manager matched only
# `DOCLING_PARSE` and `PYPDFIUM2` and fell through to
# `raise RuntimeError("Unexpected PDF backend type ...")`. Every batch document raised, so
# the benchmark scored docling 0/14 and failed the run's minimum success rate. 3.5.0 adds
# the missing branch (`convert/manager.py`, verified by diffing both wheels). Do not drop
# below it, and if this failure returns, compare jobkit's handled `PdfBackend` variants
# against the default docling resolves to before assuming the adapter is at fault. ~keep
bench-docling = ["docling-jobkit==3.5.0", "easyocr>=1.7.2"]
bench-markitdown = ["markitdown[all]==0.1.7"]
bench-mineru = ["mineru[pipeline]==3.4.5", "onnxruntime", "six"]
bench-paddleocr-python = [
"numpy>=2.0",
"paddleocr==3.7.0; python_version < '3.14'",
"paddlepaddle==3.3.1; python_version < '3.14'",
"pillow>=10.0.0",
"pymupdf==1.28.2",
"setuptools>=80.9; python_version < '3.14'",
]
bench-pymupdf4llm = ["pillow>=10.0.0", "pymupdf-layout==1.28.2", "pymupdf4llm==1.28.2"]
bench-rapidocr = ["numpy>=2.0", "onnxruntime==1.29.0", "pillow>=10.0.0", "pymupdf==1.28.2", "rapidocr==3.9.2"]
bench-unstructured = ["unstructured[docx,pdf,pptx,xlsx,md,odt,rtf,epub,org,rst]==0.27.5"]
[tool.uv]
environments = ["python_version >= '3.11'"]
# markitdown[all] (bench-markitdown) requires azure-ai-contentunderstanding>=1.2.0b1,
# which currently only publishes pre-releases; allow prereleases when no stable
# version satisfies a specifier (scoped, not a blanket opt-in). ~keep
prerelease = "if-necessary"
workspace.members = ["packages/python"]
conflicts = [
[
{ package = "xberg", group = "bench-docling" },
{ package = "xberg", group = "bench-markitdown" },
{ package = "xberg", group = "bench-mineru" },
{ package = "xberg", group = "bench-paddleocr-python" },
{ package = "xberg", group = "bench-pymupdf4llm" },
{ package = "xberg", group = "bench-rapidocr" },
{ package = "xberg", group = "bench-unstructured" },
],
]
cache-keys = [
{ file = "pyproject.toml" },
{ file = "Cargo.toml" },
{ file = "Cargo.lock" },
{ file = "crates/**/*.rs" },
{ file = "crates/**/Cargo.toml" },
]
[tool.pytest]
ini_options.timeout = 300
ini_options.testpaths = ["packages/python/tests"]
ini_options.norecursedirs = ["dist", "build", "*.egg"]
ini_options.markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests (requires running services)",
]
ini_options.asyncio_mode = "auto"
ini_options.asyncio_default_fixture_loop_scope = "function"
ini_options.filterwarnings = [
"ignore:Exception ignored in:pytest.PytestUnraisableExceptionWarning",
"ignore:pkg_resources is deprecated as an API:DeprecationWarning",
"ignore:ast.Num is deprecated and will be removed in Python 3.14:DeprecationWarning",
"ignore:datetime.datetime.utcfromtimestamp() is deprecated:DeprecationWarning",
"ignore:Deprecated call to `pkg_resources.declare_namespace('google')`:DeprecationWarning",
]
[tool.coverage]
run.branch = true
run.omit = ["benchmarks/*", "packages/python/tests/*", "scripts/*"]
run.plugins = ["covdefaults"]
run.source = ["packages/python/xberg"]
report.exclude_lines = [
"@(abc\\.)?abstractmethod",
"class .*\\bProtocol\\):",
"def __repr__",
"except ImportError:",
"if __name__ == .__main__.:",
"if sys.version_info",
"if TYPE_CHECKING:",
"pragma: no cover",
"raise NotImplementedError",
]
report.fail_under = 90