fix(ci): restore green backend gate after engine pin

Ruff: declare adapter re-exports via __all__ in docling_extractor
(F401) and sort the engine import block in the adapter test (I001).
Pytest: engine-dependent tests now importorskip the pinned engine —
CI installs light deps only and the engine repo is private, so they
skip visibly there and run in Docker/dev envs with the engine.

Verified: ruff clean; pytest 74 passed + 2 skipped without engine,
80 passed with the pinned engine v0.1.0 installed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Vadim Malanov
2026-07-07 09:45:55 +03:00
parent d100608df4
commit 1c1dceeee2
4 changed files with 32 additions and 3 deletions

View File

@@ -1,5 +1,11 @@
from pathlib import Path
import pytest
# Skip cleanly where the pinned engine is not installed (e.g. light-deps CI);
# see app/ingestion/ENGINE_SOURCE.md for the focused verification command.
pytest.importorskip("teamhub_document_recognition_engine")
def test_legacy_ocr_adapter_reexports_engine_model_and_settings(monkeypatch, tmp_path: Path) -> None:
from teamhub_document_recognition_engine import OcrResult as EngineOcrResult
@@ -34,6 +40,8 @@ def test_legacy_ocr_adapter_reexports_engine_model_and_settings(monkeypatch, tmp
def test_legacy_docling_adapter_reexports_engine_models_and_settings(monkeypatch, tmp_path: Path) -> None:
from teamhub_document_recognition_engine import (
ExtractedBlock as EngineExtractedBlock,
)
from teamhub_document_recognition_engine import (
ExtractionResult as EngineExtractionResult,
)