Skip to content

Track starlette TestClient anyio.abc.BlockingPortal deprecation until the upstream fix (starlette#3498) is released #45

Description

@seonghobae

Warning

DeprecationWarning: The anyio.abc.BlockingPortal alias is deprecated, use anyio.from_thread.BlockingPortal instead. emitted from starlette/testclient.py during the offline test suite (pytest -m 'not nim_live'), once per session.

Confirmed facts (2026-09-14)

  • Emitter: starlette TestClient (starlette/testclient.py, _PortalFactoryType / portal annotations) via anyio ≥ 4.15, which deprecated the anyio.abc.BlockingPortal alias.
  • Upstream fix: testclient imports the deprecated anyio.abc.BlockingPortal alias Kludex/starlette#3497 → PR #3498 "Use anyio.from_thread.BlockingPortal in TestClient", merged 2026-09-05 on master.
  • Latest starlette release on PyPI: 1.6.0 (2026-08-08), i.e. the fix is not released yet.
  • This repository's hash lock requirements/ci.txt pins starlette==1.3.1 and anyio==4.14.2; with anyio 4.14.x the alias is not deprecated, so CI does not currently emit the warning. A local environment resolved with a newer anyio does.
  • fastapi 0.141.1 (locked) allows starlette>=0.46.0, so adopting the fixed release will not require a fastapi change.

Not a code defect in this repository

No suppression, log filtering, or pin-back is applied. The warning cannot be removed here until starlette publishes the fix.

Next action / internal schedule

  • Adopt the first starlette release that includes #3498 by regenerating requirements/ci.txt with the documented command (pip-compile --extra=dev --generate-hashes --no-emit-index-url --output-file=requirements/ci.txt --strip-extras pyproject.toml, Python 3.11), then re-run the full offline suite with the anyio alias warning promoted to an error to prove it is gone.
  • Next review date: 2026-09-21 (check PyPI for a starlette release > 1.6.0). Internal target for adoption: within 7 days of that release.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions