Conversation
…syncio variant asyncio.iscoroutinefunction emits a DeprecationWarning on Python 3.14+ and is slated for removal in Python 3.16. Co-authored-by: Hassieb Pakzad <hassiebp@users.noreply.github.com>
Co-authored-by: Hassieb Pakzad <hassiebp@users.noreply.github.com>
Python 3.10 reaches end of life in October 2026. Raise requires-python to >=3.11, remove 3.10 from the CI matrix, and drop code paths that only existed for 3.10: the asyncio.create_task(context=...) fallback in the async generator wrapper, the typing_extensions NotRequired fallback, and the 3.11 test skips. Co-authored-by: Hassieb Pakzad <hassiebp@users.noreply.github.com>
This branch has not been deployed
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.
What does this PR do?
Drops Python 3.10, which reaches end of life in October 2026, and removes the code that only existed for it. It also fixes the one 3.15 deprecation in SDK code. Python 3.15 is not added to CI yet; see below.
requires-pythonis now>=3.11, ruff targetspy311, 3.10 is removed from the unit-test matrix, andAGENTS.mdis updated.observe.py: the async generator wrapper always usesasyncio.create_task(..., context=...)(3.11+), so thecontext.run(asyncio.create_task, ...)fallback, the version flag, and the unit test that monkeypatched it are gone.types.py:NotRequiredcomes fromtypingdirectly, without thetyping_extensionsfallback.skipif(sys.version_info < (3, 11))markers are removed from unit and e2e tests.uv.lock(regenerated with the CI-pinned uv 0.11.2) only dropsexceptiongroup,tomli, andbackports-asyncio-runner. No package versions change.inspect.iscoroutinefunctionreplacesasyncio.iscoroutinefunction, which warns on 3.14+ and is removed in 3.16. I checked that both return identical results on 3.11 through 3.15 for plain functions, partials, bound methods, static methods, andAsyncMock.tests/unit/test_media.py(blank lines only).Impact: about 10.6% of monthly PyPI downloads still come from 3.10 (pypistats). Those users will stay on 4.16.x. This should probably go out as a clearly noted minor release.
Why 3.15 is not in the matrix yet
uv sync --lockedfails on 3.15 (only 3.15.0rc2 is available; setup-python doesn't have a final yet):pydantic, 2.13.5, pinspydantic-core==2.46.5, which has no cp315 wheels. Only thepydantic2.14 betas use a 3.15-ready core. Until 2.14 ships,pip install langfuseon 3.15 has to compilepydantic-corewith Rust, whatever this SDK declares.tiktokenandormsgpack(pulled in bylangchain-openaiandlanggraph) have no cp315 wheels.With 3.15.0rc2 and
pydantic==2.14.0b2, the unit suite passes, apart from the LangChain tests, which couldn't be installed:633 passed, 2 skipped. Adding"3.15"to the matrix (plus a lock upgrade) should be a one-line follow-up once pydantic 2.14 is released.Type of change
Verification
I didn't run the e2e tests locally because they need a Langfuse server. The only e2e change is removing the 3.11 skip markers.
Checklist
code_review.md..env.templateif needed.