From 26a7628bf1a55db87b36a80a4a8942946ffbdac6 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Thu, 4 Jun 2026 10:25:55 +0300 Subject: [PATCH 1/2] chore: tighten uv_build pin and annotate retained ty:ignore comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two small follow-ups to the faststream 0.7 migration (PRs #3, #4): 1. Narrow uv_build's upper bound from <1.0 to <0.12, matching upstream's stated versioning policy (the 0.x component is where breaking changes ship, not the major). Floor moves from 0.11 to 0.11.18 — the release where uv_build was stabilized. Same posture the migration just adopted for faststream: bound on both sides. 2. Add one-line rationale comments above the two retained '# ty: ignore[invalid-argument-type]' sites in main.py. Both ignores were re-verified during PR2 (ty still fires the error on 0.7.1 if removed). The WHY is non-obvious — both stem from upstream structural type frictions that can't be solved at this layer — so a future contributor should not optimistically delete them without understanding the constraint. No behavior change. lint + tests green at 100% coverage. Co-Authored-By: Claude Opus 4.7 (1M context) --- modern_di_faststream/main.py | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modern_di_faststream/main.py b/modern_di_faststream/main.py index 017d827..b83cc10 100644 --- a/modern_di_faststream/main.py +++ b/modern_di_faststream/main.py @@ -29,6 +29,7 @@ def __call__(self, *args: P.args, **kwargs: P.kwargs) -> "_DiMiddleware[P]": class _DiMiddleware(faststream.BaseMiddleware, typing.Generic[P]): def __init__(self, di_container: Container, *args: P.args, **kwargs: P.kwargs) -> None: self.di_container = di_container + # BaseMiddleware.__init__ expects (msg, /, *, context: ContextRepo); ParamSpec forwarding can't prove that. super().__init__(*args, **kwargs) # ty: ignore[invalid-argument-type] async def consume_scope( @@ -68,6 +69,7 @@ def setup_di( container.providers_registry.add_providers(faststream_message_provider) app.context.set_global("di_container", container) app.after_shutdown(container.close_async) + # _DIMiddlewareFactory.__call__ ParamSpec doesn't structurally match BrokerMiddleware[Any, Any]. app.broker.add_middleware(_DIMiddlewareFactory(container)) # ty: ignore[invalid-argument-type] return container diff --git a/pyproject.toml b/pyproject.toml index 87ca9ee..3cde840 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ lint = [ ] [build-system] -requires = ["uv_build>=0.11,<1.0"] +requires = ["uv_build>=0.11.18,<0.12"] build-backend = "uv_build" [tool.uv.build-backend] From 084c547724b97b2ae9535b1d9b7ba0164ad351cf Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Thu, 4 Jun 2026 10:32:14 +0300 Subject: [PATCH 2/2] Revert uv_build pin tightening; keep ty:ignore annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uv_build is a build-time dependency — [build-system].requires only affects whoever runs `uv build`, not downstream installers. A breaking uv_build 0.12 surfaces as a single failing build, recoverable in one commit at that time. Tightening preemptively just creates churn at every minor bump with no user-facing protection in exchange. PR #5 now ships annotations-only. Co-Authored-By: Claude Opus 4.7 (1M context) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3cde840..87ca9ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ lint = [ ] [build-system] -requires = ["uv_build>=0.11.18,<0.12"] +requires = ["uv_build>=0.11,<1.0"] build-backend = "uv_build" [tool.uv.build-backend]