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
+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())