Modernize typing and other minor updates - #858
Merged
Merged
Conversation
mypy 1.19 is the latest supporting Python 3.9. Some type overrides have become unnecessary. The added ``ignore[override]`` annotations added to the editable waheel support code seem to be necessary for a bug in the typing of the ``importlib.resources`` code in ``typeshed`` where the method is typed to the implementation rather than to the implemented interface.
typing-extesions is a transitive dependency of mypy and is not imported when not type checking. Keep the test dependencies as lean as possible to save every bit of time in CI.
dnicolodi
force-pushed
the
modernize-typing
branch
from
June 27, 2026 13:48
fd3efd7 to
bccc210
Compare
typing-extensions is guaranteed to be installed when type checking and definitions integrated into typing are not removed from it, thus there is no reasons for the conditional imports: simply import from typing-extensions until the minimal Python version is bumped.
dnicolodi
force-pushed
the
modernize-typing
branch
from
June 27, 2026 13:50
bccc210 to
74ba34e
Compare
This allows to drop the _compat module. The places where ``str | os.PathLike[str]`` are is accepted should probably be reviewed to check whether accepting both sides of the union is a good idea.
dnicolodi
force-pushed
the
modernize-typing
branch
from
June 27, 2026 14:20
a825a6e to
33d1ab7
Compare
rgommers
approved these changes
Jun 27, 2026
rgommers
left a comment
Contributor
There was a problem hiding this comment.
Nice modernization, all LGTM - thanks @dnicolodi
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.
No description provided.