Repository navigation
chore: remove the Python 3.10 Self shims and use tomllib in a test - #261
Merged
Merged
Conversation
Part of Issue 60. Types showwindow(h, ax), the Window helper class and the stereo Cursor class, and gives the mixin a docstring. Drops a :type: line that the signature now gives. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Python 3.10 was dropped in PR 174, but seven modules still chose between typing.Self and typing_extensions.Self (six with sys.version_info, ImageReshape with try/except ImportError). They import Self from typing. The entry-points test parsed pyproject.toml with a regex because tomllib was missing in 3.10, and now uses tomllib. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
Python 3.10 was dropped in PR 174 (
requires-python = ">=3.11"), but the code still carried the shims for it. No behaviour change.ImageColor,ImageIO,ImageMorph,ImageMultiview,ImageReshape,ImageTensorand_image_typing) chose betweentyping.Selfandtyping_extensions.Self: six withif sys.version_info >= (3, 11), andImageReshapewithtry/except ImportError. They nowfrom typing import Self, and theimport syslines that this leaves unused are gone.tests/test_entry_points.pyparsedpyproject.tomlwith a regex, and its docstring said why:tomllibis only in the standard library from Python 3.11 and the package supported 3.10. It now usestomllib.I left the
typing_extensionsentry in the JupyterLite bootstrap package list (docs/notebooks/_mvtb_nb_bootstrap.py). That is installed for Pyodide and is not this shim.Stacked on PR 260 (annotate ImageIO), since both change the import lines at the top of
ImageIO.py, so PR 260 has to merge first.mypy reports no issues,
ruff formatis clean, and the full suite passes (2158 passed, 33 skipped).AI-assisted: written with Claude Code (Claude Sonnet 5.5) and reviewed by the maintainer.
🤖 Generated with Claude Code