Repository navigation
Commit d5ab213
feat(story-1.4): transport protocol and Httpx2Transport adapter
Adds the Transport protocol (Seam 1, middleware ↔ transport) and the
default Httpx2Transport implementation — the single seam where httpx2 is
imported. Adds a minimal StreamResponse placeholder so the protocol's
stream() signature can be typed today and fleshed out in Story 4.1.
- src/httpware/transports/__init__.py: @runtime_checkable Transport
Protocol with __call__ / stream / aclose
- src/httpware/transports/httpx2.py: Httpx2Transport adapter; lazy
AsyncClient init guarded by asyncio.Lock; httpx2.{TimeoutException,
HTTPError, InvalidURL, CookieConflict} and the closed-client
RuntimeError mapped to httpware.{TimeoutError, TransportError} with
the original message preserved on the mapped instance
- src/httpware/response.py: StreamResponse placeholder (status, headers,
url) re-exported from httpware/__init__.py
- tests/test_no_httpx2_leakage.py: CI invariant — only
transports/httpx2.py may import httpx2; cwd-robust pathing
- tests/test_transports_httpx2.py: 63 unit tests covering protocol
membership, success / 4xx / 5xx / exception-mapping / lazy-init /
concurrent-init / post-close paths
- docs/stories/1-4-...: story spec + Review Findings with 3-layer
adversarial review outcome
- docs/deferred-work.md: 5 review-time deferrals + extended
case-insensitive-headers entry to cover multi-value collapse
- CHANGELOG.md: Unreleased / Added entry
Full suite 140 passing, 100% coverage on every source module, lint
green (ruff + ty), httpx2 leakage invariant holds.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 2e49b61 commit d5ab213
9 files changed
Lines changed: 1189 additions & 4 deletions
File tree
- docs
- stories
- src/httpware
- transports
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
5 | 19 | | |
6 | 20 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 21 | + | |
10 | 22 | | |
11 | 23 | | |
12 | 24 | | |
| |||
0 commit comments