Add uv.lock and bump mypy target to 3.12

Adds the uv lockfile generated from pyproject.toml and updates

tool.mypy.python_version to 3.12 so third-party stubs parse cleanly

while keeping runtime compatibility at Python 3.11.
This commit is contained in:
2026-08-21 16:44:04 +02:00
parent 865b3bc6a9
commit 2e81fa57bd
3 changed files with 1169 additions and 1 deletions
+4 -1
View File
@@ -41,7 +41,10 @@ asyncio_mode = "auto"
pythonpath = ["src"]
[tool.mypy]
python_version = "3.11"
# Checked against Python 3.12 (the project's venv interpreter) so that third-party
# stubs using newer syntax (e.g. numpy >= 2.5) parse cleanly. The code itself
# must stay compatible with the 3.11 minimum declared in `requires-python`.
python_version = "3.12"
strict = true
warn_return_any = true
warn_unused_ignores = true
+14
View File
@@ -70,3 +70,17 @@ async def test_vlm_classifier_fallback(blank_image: Image.Image) -> None:
result = await classify_document(Path("unknown.png"), [blank_image], client, Settings())
assert result.category == DocumentClass.handwritten
assert result.confidence == 0.91
@pytest.mark.asyncio
async def test_empty_pages_raises() -> None:
"""The VLM fallback must fail cleanly for documents with no renderable pages."""
from odoo_ocr.config import Settings
from tests.conftest import FakeVLMClient
client = FakeVLMClient()
with (
patch("odoo_ocr.pipeline.classifier._heuristic_classify", return_value=None),
pytest.raises(ValueError, match="no renderable pages"),
):
await classify_document(Path("empty.pdf"), [], client, Settings())
Generated
+1151
View File
File diff suppressed because it is too large Load Diff