Files
julian 0411b71c2d
Build & push images / images (push) Successful in 4m7s
fix(vision): CI has no numpy — the vehicle-stage tests need it without the alpr extra
CI syncs the service with `uv sync --frozen` (no extra), so test_vehicle.py's module-level
numpy import broke collection in ci.yml and both build-images runs. numpy joins the dev
group (the service imports it lazily); the one test that resizes with OpenCV skips when
cv2 is absent. Reproduced locally in a CI-identical env: 13 passed, 1 skipped; ruff + mypy clean.

Claude-Session: https://claude.ai/code/session_01FWncR69HgGPuei1dLrW3cU
2026-09-07 08:51:53 +02:00

66 lines
2.1 KiB
TOML

[project]
name = "parking-vision"
version = "0.0.0"
description = "Host-side ANPR / vehicle-verification microservice for the parking system (separate process; localhost HTTP)."
requires-python = ">=3.10,<4.0"
# Core deps are LIGHT on purpose: the service boots, serves /health, and answers
# /analyze in stub mode with ONLY these. The heavy recognizer stack (fast-alpr +
# onnxruntime + model weights) is the optional `alpr` extra, so `uv sync` and the test
# suite work offline without downloading models. See
# wiki/decisions/vision-service-packaging.md + wiki/entities/opencv-anpr-service.md.
dependencies = [
"fastapi>=0.115",
"uvicorn[standard]>=0.32",
"pydantic>=2.9",
"pydantic-settings>=2.6",
]
[project.scripts]
vision-recognize = "vision_service.cli:main"
[project.optional-dependencies]
# The real recognizer. Install with: uv sync --extra alpr
# fast-alpr is MIT (YOLOv9 detector + CCT OCR, both MIT) on ONNX Runtime — see the
# recognizer evaluation in wiki/entities/opencv-anpr-service.md. onnxruntime is the
# CPU backend; swap for onnxruntime-gpu / -openvino / -directml on capable hardware.
alpr = [
"fast-alpr>=0.4.0",
"onnxruntime>=1.19",
]
[dependency-groups]
# Dev tooling (uv installs these by default for local work; excluded from the runtime image).
dev = [
"ruff>=0.8",
"pytest>=8.3",
"httpx>=0.27", # FastAPI TestClient transport
"mypy>=1.13",
# The vehicle stage's post-processing tests run on synthetic tensors without the model
# stack (CI syncs WITHOUT the alpr extra); the service itself imports numpy lazily.
"numpy>=1.26",
]
[tool.ruff]
line-length = 110
target-version = "py310"
[tool.ruff.lint]
# A pragmatic default set: pyflakes, pycodestyle, isort, bugbear, pyupgrade.
select = ["E", "F", "I", "B", "UP"]
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.mypy]
python_version = "3.10"
strict = true
# fast-alpr / onnxruntime ship without type stubs; don't fail typecheck on the optional stack.
ignore_missing_imports = true
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["vision_service"]