-
Notifications
You must be signed in to change notification settings - Fork 509
Expand file tree
/
Copy pathpyproject.toml
More file actions
99 lines (95 loc) · 3.9 KB
/
Copy pathpyproject.toml
File metadata and controls
99 lines (95 loc) · 3.9 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
[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",
"pyrefly>=1.1.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",
"types-pillow>=10.2",
"types-psutil>=7.2.2.20260508",
"validate-pyproject>=0.24.1",
]
bench-docling = ["docling>=2.64.1"]
bench-markitdown = ["markitdown[all]>=0.1.4"]
# `six` is an undeclared runtime import in mineru's pytorch_paddle OCR module
# (mineru.model.utils.pytorchocr) — without it every extraction dies with
# `ModuleNotFoundError: No module named 'six'`. Pin it in until mineru fixes
# its own metadata.
bench-mineru = ["mineru[pipeline]>=2.6.7", "onnxruntime", "six"]
bench-pymupdf4llm = ["pillow>=10.0.0", "pymupdf-layout>=0.0.1", "pymupdf4llm>=0.0.17"]
# Format-specific extras for the `fast` (no-OCR) partition strategy the
# benchmark uses (pdfminer/python-docx/python-pptx/openpyxl). Avoids the
# `[all-docs]` `unstructured-inference`/`pypdfium2>=5` stack that pulled the
# Python-3.11-incompatible llvmlite 0.36 and conflicted with mineru's pypdfium2.
bench-unstructured = ["unstructured[docx,pdf,pptx,xlsx,md,odt,rtf,epub,org,rst]==0.18.32"]
doc = ["mkdocstrings>=1.0.4", "mkdocstrings-python>=2.0.3", "zensical"]
[tool.uv]
# Restrict the resolution universe to the Python versions our CI and dev
# environments actually use. Without this, requires-python = ">=3.10" forces
# uv to keep both onnxruntime 1.24.x (last build with 3.10 wheels) and 1.26.x
# (3.11+) in the lock; the install step then ambiguously matches both rows
# on a single bench group and errors with "Found multiple packages matching
# `onnxruntime`" when syncing bench-mineru or bench-unstructured. Restricting
# uv's environment universe to 3.11+ collapses each transitive dep to a
# single version while leaving the published abi3-py310 wheel untouched (that
# distribution is driven by maturin, not uv).
environments = ["python_version >= '3.11'"]
workspace.members = ["packages/python"]
conflicts = [
[
{ package = "xberg", group = "bench-docling" },
{ package = "xberg", group = "bench-markitdown" },
{ package = "xberg", group = "bench-mineru" },
{ package = "xberg", group = "bench-pymupdf4llm" },
{ 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