Skip to content

Bump mypy to 2.4 - #5365

Merged
abravalheri merged 4 commits into
pypa:mainfrom
abravalheri:mypy-cygwin
Oct 29, 2026
Merged

abravalheri merged 4 commits into
pypa:mainfrom
abravalheri:mypy-cygwin

Conversation

@abravalheri

Copy link
Copy Markdown
Contributor

This PR is a spin-off of #5343, isolating the mypy version bump so the original PR isn't polluted with extra side quests.

Context: newer typing features used in #5343, such as PEP 661 sentinels in unions like str | _RESET, are only recognised by recent mypy. mypy 2.4.0 is the first release that accepts them; older pins report them as invalid type expressions.

The problem however is that the CI is failing to install them on Cygwin.

According to the discussion in the thread python/mypy#21460 (comment) there is a chance it could work, so the idea behind this PR is further investigation.

(Since Cygwin is a platform that is not broadly available, I will have to rely on the CI to run the tests step by step on each change, so expect some follow up commits...)

- Update mypy pin in pyproject.toml
- Add targeted type: ignore[misc] for Distribution.global_options
  (mypy cannot resolve the ClassVar since _distutils is excluded)
Some new typing features are only available on latest versions of mypy,
which don't seem to be installable on Cygwin.
@abravalheri

Copy link
Copy Markdown
Contributor Author

According to python/mypy#21460 (comment), the advice is to skip it for now.

Comment thread .github/workflows/main.yml Outdated
@Avasam

Avasam commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

The problem however is that the CI is failing to install them on Cygwin.
[...]
According to python/mypy#21460 (comment), the advice is to skip it for now.

Similar as PyPy, there's no need to run on cygwin in the first place. Just disable permanently: jaraco/skeleton#187

@abravalheri

abravalheri commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Thank you very much Avasam. I remember seeing in some PR that Jason wanted to wait for Python 3.15 to be fixed before more features in setuptools, but I think I will go ahead and merge this one...then go back to the bug fix in #5343.

@abravalheri
abravalheri merged commit 5d7ecb2 into pypa:main Oct 29, 2026
25 of 26 checks passed
@abravalheri
abravalheri deleted the mypy-cygwin branch October 29, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants