Modernize for a Python 3.13 minimum#62
Merged
Merged
Conversation
Raise the supported Python floor from 3.9 to 3.13 and update the code and docs to match. - pyproject.toml: requires-python >=3.13 and ty environment python-version 3.13; enable ruff's pyupgrade (UP) rules to keep syntax modern. - CI: drop the 3.9-3.12 test matrix entries, keeping 3.13 and 3.14. - types.py: use PEP 695 `type` aliases and PEP 604 `|` unions instead of typing.Union. - pointer.py / produce.py: import Hashable, Iterable and Callable from collections.abc instead of the deprecated typing aliases; drop now- redundant string-quoted forward references. - README and docs: state Python 3.13 as the minimum. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SmQNvz1tx2xncasEyUoVdR
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.
Raises the supported Python floor from 3.9 to 3.13 and modernizes the code and docs to match. No behavior changes — the public API, semantics, and 100% coverage are unchanged.
Version floor
pyproject.toml:requires-python = ">=3.13", and thetyenvironmentpython-versionbumped to3.13(kept matched torequires-python, as its comment intends).index.md,installation.md) now state Python 3.13 as the minimum.Syntax modernization (enabled by the 3.13 floor)
types.py: theDiffableandOperationaliases now use PEP 695typestatements, and unions use PEP 604|instead oftyping.Union. Both aliases are annotation-only, so this is purely a spelling change.pointer.py/produce.py:Hashable,Iterable, andCallablenow come fromcollections.abcinstead of the deprecatedtypingaliases; removed the now-redundant string-quoted forward references (from __future__ import annotationsis already in effect).Linting
UP) rule set so outdated syntax is caught against the supported Python floor going forward. The whole tree is already clean under it.Verification
pytestwith the--cov-fail-under=100gate: 411 passed, 100% coverage, on Python 3.13.ruff check,ruff format --check, andty checkall clean.uv build+twine checkpass.🤖 Generated with Claude Code
Generated by Claude Code