Bump minimum Python to 3.13 and modernize - #198
Merged
Conversation
Raise the minimum supported Python version to 3.13 and apply the modernizations that unlocks: - pyproject.toml: requires-python >=3.13; ty environment python-version 3.13 - CI: drop the 3.9-3.12 test matrix rows, keep 3.13 and 3.14 - README/docs: update the advertised minimum version Source: - Adopt PEP 695 type-parameter syntax for the generic Proxy/Watcher classes, the computed/watch helpers and the Watchable/WatchCallback aliases, dropping the module-level TypeVar and typing.Generic bases - init.py: drop the getattr guard around asyncio.eager_task_factory, which now always exists - watcher.py: import TypeIs from typing (added in 3.13) instead of typing_extensions Tests: - Remove sys.version_info / hasattr(asyncio, "eager_task_factory") guards that are now always true - Exclude __type_params__ (added by the native PEP 695 generic) from the wrapping-completeness check Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGH6yjPx1mpY134qtk6rXa
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
Raise the minimum supported Python version to 3.13 and apply the modernizations that unlocks across the package, tests, CI and docs.
Version bump
pyproject.toml:requires-python = ">=3.13", and thetyenvironmentpython-versionbumped to3.13(so the type checker keeps matching the oldest supported version).3.9–3.12rows from the test matrix, keeping3.13and3.14.Source modernization (unlocked by requiring ≥ 3.12/3.13)
ProxyandWatchernow use the native type-parameter syntax (class Proxy[T]:), as doproxy/ref/readonly/computed/watch/watch_effect/to_rawand theWatchable/WatchCallbacktype aliases. This removes the module-levelTypeVarand thetyping.Genericbases. Runtime behaviour is unchanged.asyncio.eager_task_factory:loop_factory()drops thegetattrguard — the attribute always exists now.TypeIs: imported fromtyping(added in 3.13) instead oftyping_extensions.RefTypedDictno longer needs its "requires 3.11" note.Test cleanup
sys.version_info/hasattr(asyncio, "eager_task_factory")guards that are now always true (test_init.py,test_asyncio.py).__type_params__(added by the native PEP 695 generic) from the wrapping-completeness check intest_collections.py, alongside the existingGenericartifacts.Validation
On Python 3.13, all of the following pass locally:
ruff check .andruff format --check .ty checkpytest tests— 218 passed, 1 xfaileduv build+twine checkon the resulting wheel/sdist🤖 Generated with Claude Code
https://claude.ai/code/session_01XGH6yjPx1mpY134qtk6rXa
Generated by Claude Code