Files
hyprland-headless-stream-pl…/tests/unit
HermenixandClaude Opus 5 8a0c9ca74d fix(mcp): declare the HTTP transport's dependencies, and forbid its tests to skip
`starlette` and `uvicorn` arrive through the MCP SDK today -- measured,
both of them -- and relying on that is exactly the trap this project
already wrote down twice.  `src/hhstream_mcp/pyproject.toml` declares
`anyio` rather than taking it for granted through the SDK because
`server.py` uses it by name; `http.py` imports `uvicorn` by name and sits
on Starlette's `Request` through the SDK's `TransportSecuritySettings`,
so both belong in the metadata on the same argument.  An SDK release that
moved its HTTP transport behind an optional extra would otherwise break
`serve --http` with an ImportError naming somebody else's package.
`nix/mcp.nix` carries them for the same reason.

The worse half was in the gate.  `tests/unit/test_mcp_http.py` opened
with `pytest.importorskip("starlette.testclient")`, which is the pattern
`checks/unit.nix`'s own comment argues against in as many words: "a file
that skipped when the SDK was absent would be green in exactly the build
where that mattered".  It would not skip today -- `mcp` propagates
starlette and httpx -- but the day it did, 43 tests would leave the gate
and nothing would say so, because pytest exits 0 when every test was
skipped.

So the import is unconditional now, `checks/unit.nix` declares `starlette`
and `httpx` explicitly, and the check proves them importable before
pytest runs, beside the lines that already do that for `hhstream` and the
tool table.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KchcvnbfhhZhUHy83YL3Ya
2026-10-11 22:49:44 +00:00
..
2026-10-09 11:32:42 -04:00