Skip to content

feat: support Python 3.11 and 3.12#119

Merged
lesnik512 merged 7 commits into
mainfrom
feat/python-3.11-3.12-support
Jun 30, 2026
Merged

feat: support Python 3.11 and 3.12#119
lesnik512 merged 7 commits into
mainfrom
feat/python-3.11-3.12-support

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

Lowers the supported-Python floor from 3.13 to 3.11, so the package installs and runs on 3.11, 3.12, 3.13, and 3.14. Pure-Python library with no compiled extensions, so this is a source-compatibility + metadata change plus a wider CI matrix. Mirrors the change shipped in the sibling repo faststream-redis-timers (#49).

What changed

  • Backport two 3.12+/3.13 typing symbols via typing_extensions (declared as a direct runtime dependency, no sys.version_info gating):
    • override (3.12) — broker.py, subscriber/usecase.py, registrator.py, publisher/usecase.py
    • get_protocol_members (3.13) — tests/test_fake.py, tests/test_unit.py (surfaced by ty once the floor dropped)
  • pyproject.tomlrequires-python >=3.13,<4>=3.11,<4; add typing-extensions>=4.12.0; add 3.11/3.12 classifiers; ruff target-version py313py311.
  • CI — add 3.11 and 3.12 to the pytest matrix (lint job stays on 3.13).

Verification

  • Full docker suite: 543 passed, 100% coverage on the default interpreter.
  • No-Postgres suites run green on a real CPython 3.11.9 (tests/test_unit.py + tests/test_fake.py, 366 passed).
  • just lint-ci clean (ruff + ty + planning validator).
  • Cross-cutting scan + live 3.11 py_compile of faststream_outbox/ + tests/ confirm no residual 3.12+ symbol or PEP 695 syntax.

No behavior change: typing_extensions re-exports the identical stdlib objects on 3.12+. Dockerfile, architecture/ docs, and uv.lock (git-ignored) are unchanged.

Planning bundle: planning/changes/2026-06-30.01-python-3.11-3.12-support/.

🤖 Generated with Claude Code

Backport typing.override via typing_extensions, lower requires-python to
>=3.11, add 3.11/3.12 classifiers and ruff target.

Also backport typing.get_protocol_members (3.12+) in test files via
typing_extensions, which ty caught when the floor moved to 3.11.
On Python 3.11 the move_on_after cancellation inside broker.ping() unwinds
through the test task and coverage.py's C tracer drops the test frame's
trace function for the rest of the body, so the trailing assert reads as
uncovered (99% < 100% gate) even though it runs and passes. 3.12+ uses
sys.monitoring and is unaffected. Awaiting the probe via asyncio.create_task
keeps the cancellation inside the child frame, restoring line tracing.
Behavior is unchanged: ping(timeout=0.05) still returns False on a hung probe.
…version

Without an explicit pin, uv sync selects an interpreter via discovery order
(no .python-version/--python set), which works today but relies on a heuristic
that could regress to always picking the newest. Pin lint to 3.13 and each
pytest leg to its matrix version, matching the db-retry/sibling convention.
@lesnik512 lesnik512 merged commit 05eded9 into main Jun 30, 2026
5 checks passed
@lesnik512 lesnik512 deleted the feat/python-3.11-3.12-support branch June 30, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant