Skip to content

Modernize typing and other minor updates - #858

Merged
rgommers merged 7 commits into
mesonbuild:mainfrom
dnicolodi:modernize-typing
Jun 27, 2026
Merged

Modernize typing and other minor updates#858
rgommers merged 7 commits into
mesonbuild:mainfrom
dnicolodi:modernize-typing

Conversation

@dnicolodi

Copy link
Copy Markdown
Member

No description provided.

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.
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.
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.
@rgommers rgommers added the maintenance Regular code improvements that are not new features nor end-user-visible bugs label Jun 27, 2026

@rgommers rgommers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice modernization, all LGTM - thanks @dnicolodi

@rgommers
rgommers merged commit cfdee34 into mesonbuild:main Jun 27, 2026
35 checks passed
@rgommers rgommers added this to the v0.21.0 milestone Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Regular code improvements that are not new features nor end-user-visible bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants