Bump anyio from 4.10.0 to 4.14.2 - #3547
dependabot[bot] wants to merge 1 commit into
Conversation
| [[package]] | ||
| name = "anyio" | ||
| version = "4.10.0" | ||
| version = "4.14.2" |
There was a problem hiding this comment.
🔴 Maintainers get a failing uv run --frozen pyright pre-commit/CI job after this bump that passes on the base. anyio 4.14 narrowed TaskGroup.start_soon() to callables returning coroutines, but _spawn at src/mcp/shared/jsonrpc_dispatcher.py:686 hands it fn: Callable[..., Awaitable[Any]], so strict pyright reports reportArgumentType. Fix: give start_soon a coroutine-returning static type, e.g. type _spawn's fn as Callable[..., Coroutine[Any, Any, Any]] and make the _shielded_progress/_contained_notify wrappers (or an async def shim inside _spawn) satisfy it, so every _spawn caller still type-checks. Runtime is unaffected: all callers pass async def functions.
Extended reasoning...
This is a typecheck break, not a runtime one; the condition is anyio 4.14.2's start_soon annotation being Coroutine-returning (the PR's own release notes state the narrowing from arbitrary awaitables, reverting v3.7.0).
uv.lock:73 now pins anyio 4.14.2; pyproject.toml:159 sets typeCheckingMode = "strict" with venv = ".venv", so pyright reads anyio's annotations from the locked install.
.pre-commit-config.yaml:47 runs uv run --frozen pyright; .github/workflows/shared.yml:27-29 syncs --frozen and runs pre-commit, so CI executes this against 4.14.2.
src/mcp/shared/jsonrpc_dispatcher.py:671-686: _spawn(self, fn: Callable[..., Awaitable[Any]], *args, sender_ctx) ends with self._tg.start_soon(fn, *args) at line 686 with no # pyright: ignore.
Awaitable[Any] is not assignable to Coroutine[Any, Any, Any] (nor to any coroutine-like protocol with send/throw), so pyright emits an argument-type error there. Line 684 (sender_ctx.run(self._tg.start_soon, fn, *args)) is not flagged because Context.run takes *args: Any.
On the base, anyio 4.10 annotates the…
Verification: normal — triggered whenever the locked anyio 4.14.2 is installed (pre-commit job: .github/workflows/shared.yml:27 uv sync --frozen --all-extras then pre-commit --all-files, whose pyright hook is uv run --frozen pyright at .pre-commit-config.yaml:47) and anyio 4.14's TaskGroup.start_soon is annotated as taking a Coroutine-returning callable, which is what anyio's 4.14.0 changelog entry…
Bumps [anyio](https://github.com/agronholm/anyio) from 4.10.0 to 4.14.2. - [Release notes](https://github.com/agronholm/anyio/releases) - [Commits](agronholm/anyio@4.10.0...4.14.2) --- updated-dependencies: - dependency-name: anyio dependency-version: 4.14.2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
dca80a1 to
a62369f
Compare
Bumps anyio from 4.10.0 to 4.14.2.
Release notes
Sourced from anyio's releases.
... (truncated)
Commits
c384f99Bumped up the versiondbba29dFixed 100% CPU spin on cancel scope misuse (#1217)6bbc6c3Fix CapacityLimiter over-granting tokens on asyncio (#1172)6f82b25Refactored TestTLSStream.test_receive_invalid_max_bytes() to be less flakybe24b04Relaxed timeouts to fix test flakiness8113506Fix test flakiness caused by slow callback duration logging1e988b6Fixed CapacityLimiter raising trio.WouldBlock instead of anyio.WouldBlock (#1...44713f3Pin setup-uv to a commit sha across downstream jobs (#1213)f1b7301Fixed stderr writes in a worker subprocess causing a deadlock (#1207)212be93Fix flaky test_tcp_listener_same_port using a hardcoded port (#1206)