fix(vision): dichiara le dipendenze del worker, pin numerico HTTP vs runner
Ruling R9: separa l'extra vision (runner: 4 pacchetti VisionSuite + numpy) da vision-worker (fastapi, uvicorn, pillow, python-multipart, sopra vision). Prima il worker risolveva solo perche' vs-pm2d le lista per conto suo; un domani lo stub di stazione dovra' incorporare il runner senza trascinarsi dietro un server web che non gli serve. Aggiorna Dockerfile.vision e README.md al nuovo extra; il test del worker ora pinna anche il valore numerico del diametro (non solo la chiave), agganciato alla stessa tolleranza del test in-process del runner. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014BBnuACZSCJqXrMYC3LUMU
This commit is contained in:
@@ -16,7 +16,7 @@ pytest.importorskip(
|
||||
reason=(
|
||||
"the vision tree requires Python >=3.13 (vs-task/vs-measure/vs-pm2d "
|
||||
"declare it upstream); run it with "
|
||||
"`uv run --python 3.13 --extra vision --extra dev pytest "
|
||||
"`uv run --python 3.13 --extra vision-worker --extra dev pytest "
|
||||
"src/vision_worker/tests`"
|
||||
),
|
||||
)
|
||||
@@ -75,6 +75,12 @@ async def test_run_returns_the_named_outputs():
|
||||
body = response.json()
|
||||
assert body["failures"] == []
|
||||
assert any(key.endswith(".diameter") for key in body["outputs"])
|
||||
# Pinned to src/vision/tests/test_runner.py's in-process expectation
|
||||
# (same graph, same image, same tolerance) - the whole point of a shared
|
||||
# engine_version is that the number does not depend on which path
|
||||
# computed it.
|
||||
diameter = next(v for k, v in body["outputs"].items() if k.endswith(".diameter"))
|
||||
assert diameter == pytest.approx(120.0, abs=4.0)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user