From 30736f9bf13ec319839cd8307ed4d38a3981578d Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Mon, 13 Jul 2026 16:51:07 +0300 Subject: [PATCH] docs(release): add 2.2.0 release notes --- planning/releases/2.2.0.md | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 planning/releases/2.2.0.md diff --git a/planning/releases/2.2.0.md b/planning/releases/2.2.0.md new file mode 100644 index 0000000..3784935 --- /dev/null +++ b/planning/releases/2.2.0.md @@ -0,0 +1,52 @@ +# modern-di-aiohttp 2.2.0 — adopt the modern-di integration kit + +Maintenance release. **No public API change** — `FromDI`, `inject`, +`setup_di`, `fetch_di_container`, `fetch_request_container`, and the +connection providers keep their signatures and behavior. Swaps this +package's hand-rolled connection dispatch and marker resolution for the +shared primitives in +[`modern_di.integrations`](https://github.com/modern-python/modern-di/blob/main/architecture/integration-kit.md), +shipped in +[modern-di 2.28.0](https://github.com/modern-python/modern-di/releases/tag/2.28.0). +Fourth of 13 planned adapter conversions across the `modern-di` ecosystem +(after +[`modern-di-starlette` 2.2.0](https://github.com/modern-python/modern-di-starlette/releases/tag/2.2.0), +[`modern-di-fastapi` 2.10.0](https://github.com/modern-python/modern-di-fastapi/releases/tag/2.10.0), +and +[`modern-di-litestar` 2.13.0](https://github.com/modern-python/modern-di-litestar/releases/tag/2.13.0)). + +## Internal refactors + +- **`_di_middleware` keeps its own `can_prepare()` handshake probe** to + select `aiohttp_websocket_provider` or `aiohttp_request_provider` — this + package is a documented outlier: both providers bind `web.Request` (a + WebSocket is an upgraded HTTP request at aiohttp's middleware entry + point), so `integrations.classify_connection`'s isinstance-over-tuple + dispatch cannot distinguish them. Once the provider is picked, + **`integrations.bind(provider, request)`** now derives the scope/context + the middleware used to hand-write. `bind()` never returns `None`, so no + fallback branch is needed. +- **The child container's manual `try`/`finally: await + child_container.close_async()` is now `Container`'s own `async with`** — + entering an already-open container is a no-op; exiting closes it, + including on the exception path. +- **`_FromDI`/`_parse_inject_params`/`_resolve_di_params` are gone.** + `FromDI = integrations.from_di`; `inject` now composes + `integrations.parse_markers`/`integrations.resolve_markers`. + +## Packaging + +- Bumps the `modern-di` floor to `>=2.28.0,<3`. + +## Downstream + +No action needed — the public API (`FromDI`, `inject`, `setup_di`, +`fetch_di_container`, `fetch_request_container`, +`aiohttp_request_provider`/`aiohttp_websocket_provider`) is unchanged. +Upgrading only requires `modern-di>=2.28.0`. + +## Internals + +- 100% line coverage; `ruff`, `ty` clean across Python 3.10–3.14. +- Built via `subagent-driven-development`: 5 planned tasks, each with an + independent spec+quality review; a whole-branch review before merge.