feat: support Python 3.11 and 3.12#119
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
typingsymbols viatyping_extensions(declared as a direct runtime dependency, nosys.version_infogating):override(3.12) —broker.py,subscriber/usecase.py,registrator.py,publisher/usecase.pyget_protocol_members(3.13) —tests/test_fake.py,tests/test_unit.py(surfaced bytyonce the floor dropped)pyproject.toml—requires-python>=3.13,<4→>=3.11,<4; addtyping-extensions>=4.12.0; add 3.11/3.12 classifiers; rufftarget-versionpy313→py311.3.11and3.12to the pytest matrix (lint job stays on 3.13).Verification
tests/test_unit.py+tests/test_fake.py, 366 passed).just lint-ciclean (ruff +ty+ planning validator).py_compileoffaststream_outbox/+tests/confirm no residual 3.12+ symbol or PEP 695 syntax.No behavior change:
typing_extensionsre-exports the identical stdlib objects on 3.12+.Dockerfile,architecture/docs, anduv.lock(git-ignored) are unchanged.Planning bundle:
planning/changes/2026-06-30.01-python-3.11-3.12-support/.🤖 Generated with Claude Code