Skip to content

Bump minimum Python to 3.13 and modernize - #198

Merged
Korijn merged 1 commit into
masterfrom
claude/python-3.13-modernize-yrzdt5
Jul 21, 2026
Merged

Bump minimum Python to 3.13 and modernize#198
Korijn merged 1 commit into
masterfrom
claude/python-3.13-modernize-yrzdt5

Conversation

@Korijn

@Korijn Korijn commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

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 the ty environment python-version bumped to 3.13 (so the type checker keeps matching the oldest supported version).
  • CI: dropped the 3.93.12 rows from the test matrix, keeping 3.13 and 3.14.
  • README + docs: updated the advertised minimum version.

Source modernization (unlocked by requiring ≥ 3.12/3.13)

  • PEP 695 generics: Proxy and Watcher now use the native type-parameter syntax (class Proxy[T]:), as do proxy/ref/readonly/computed/watch/watch_effect/to_raw and the Watchable/WatchCallback type aliases. This removes the module-level TypeVar and the typing.Generic bases. Runtime behaviour is unchanged.
  • asyncio.eager_task_factory: loop_factory() drops the getattr guard — the attribute always exists now.
  • TypeIs: imported from typing (added in 3.13) instead of typing_extensions.
  • The Ref TypedDict no longer needs its "requires 3.11" note.

Test cleanup

  • Removed sys.version_info / hasattr(asyncio, "eager_task_factory") guards that are now always true (test_init.py, test_asyncio.py).
  • Excluded __type_params__ (added by the native PEP 695 generic) from the wrapping-completeness check in test_collections.py, alongside the existing Generic artifacts.

Validation

On Python 3.13, all of the following pass locally:

  • ruff check . and ruff format --check .
  • ty check
  • pytest tests — 218 passed, 1 xfailed
  • uv build + twine check on the resulting wheel/sdist

🤖 Generated with Claude Code

https://claude.ai/code/session_01XGH6yjPx1mpY134qtk6rXa


Generated by Claude Code

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
@Korijn
Korijn merged commit 6cd6f7e into master Jul 21, 2026
7 checks passed
@Korijn
Korijn deleted the claude/python-3.13-modernize-yrzdt5 branch July 21, 2026 19:18
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.

2 participants