Repository navigation
Modernize codebase to Python 3.10+ - #332
Merged
Merged
Conversation
Collaborator
|
Not too controversial, end of life is end of life and rich-click has been overly generous about supporting old Python versions. I'll look over this weekend but I imagine it's pretty straightforward. |
Drop support for Python 3.8 and 3.9; minimum is now Python 3.10. - Adopt PEP 604 unions (`X | None`) and PEP 585 builtin generics (`list`, `dict`, `tuple`, `type`) throughout, importing ABCs from `collections.abc`. - Remove version-conditional shims for Python <3.10: the `entry_points` 3.7 compat wrapper, the `Concatenate`/`ParamSpec` typing fork, and the `<3.9` skip in the type tests. - Add the `UP` (pyupgrade) ruff rule; bump ruff to v0.15.15 and set black/ruff/pyright targets to py310. - Set `warn_unused_ignores = false` so one set of `# type: ignore`s works across mypy >=1.14.1, and drop the CI `mypy<1.16` pin (was only needed for Python 3.8). - Drop 3.8/3.9 from CI matrices; tidy `subprocess.run` to `capture_output`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
ewels
force-pushed
the
modernize-python-3.10
branch
from
June 3, 2026 06:10
34602d0 to
bccbdb0
Compare
Reassigning the typed headers/rows variables to zip() tuples broke their declared list types. Use an explicit branch that preserves the list types. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
dwreeves
approved these changes
Jun 17, 2026
dwreeves
left a comment
Collaborator
There was a problem hiding this comment.
Seems fine to me.
The one thing I would say is that removing support for a Python version makes more sense to me as a minor version release, not a patch release, so this should correspond with that.
Resolve conflicts with the dev-tooling overhaul on main: - pre-commit → prek: drop `.pre-commit-config.yaml` and the old workflow; main's `prek.toml` already pins a newer ruff than this branch did. - Dev/docs requirements now live in dependency groups, so the `optional-dependencies` edits here are obsolete. Simplified the dev group's `mypy` marker now that the floor is Python 3.10. - Dropped `[tool.black]` (main replaced Black with `ruff format`) and the `warn_unused_ignores = false` workaround (the dev group pins mypy >=2.3, so a single set of ignores no longer has to span several mypy versions). - Kept the modernised annotations in the source files, and took main's versions of the `RichContext.__enter__`/`__exit__` removal and the panel table filtering fix. - `RichHelpFormatter.write_dl` takes `Iterable` again to stay compatible with the click supertype.
Owner
Author
|
Thanks for checking this over @dwreeves Let's merge this in. Feels like a nice complement to the dev tooling updates, and good to get it all done in one pass (more or less). |
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.
Slightly more controversial PR.. Opening at least partially just for discussion.
Drops support for Python 3.8 and 3.9 (now both EOL); minimum is now Python 3.10. This allows us to clean up the code quite a bit:
X | Noneinstead ofOptional/Union) and PEP 585 builtin generics (list,dict,tuple,type) throughout, with ABCs imported fromcollections.abc.entry_points()3.7 compat wrapper incli.pyConcatenate/ParamSpectyping_extensionsfork indecorators.py<3.9skip intests/test_types.pyUP(pyupgrade) ruff rule and setruff/pyrighttargets to py310.pytest,scheduled-tests,test-examples).subprocess.run(stdout=PIPE, stderr=PIPE)→capture_output=Truein test helpers.Merged
mainin, which resolved against the dev-tooling overhaul that landed since this branch was opened:.pre-commit-config.yamland the old workflow are gone, andprek.tomlalready pins a newer ruff than this branch bumped to.optional-dependenciesedits here are obsolete; the dev group'smypymarker is simplified now that the floor is 3.10.[tool.black]dropped (main replaced Black withruff format), and thewarn_unused_ignores = falseworkaround is no longer needed — the dev group pinsmypy>=2.3, so a single set of# type: ignores no longer has to span several mypy versions.RichContext.__enter__/__exit__removal and the panel table filtering fix.RichHelpFormatter.write_dltakesIterableagain, to stay compatible with the click supertype.prek run -aand the test suite pass, on the dev env (3.11) and on 3.10.🤖 Generated with Claude Code