FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Don't error unnecessarily about new syntax in dependencies where we ignore errors anyways by A5rocks · Pull Request #21883 · python/mypy · GitHub

/ mypy Public

Don't error unnecessarily about new syntax in dependencies where we ignore errors anyways - #21883

Open
A5rocks wants to merge 2 commits into
python:masterfrom
A5rocks:ignore-new-features
Open

Don't error unnecessarily about new syntax in dependencies where we ignore errors anyways#21883
A5rocks wants to merge 2 commits into
python:masterfrom
A5rocks:ignore-new-features

Conversation

A5rocks commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

This fixes #21178 (at least my own root cause for it). This is actually a bit trickier than I thought (you can read that issue to see what I thought would work, which was naive!). However, even though we use the ast module and cannot make the errors nonblocking, we can work around the root cause of that issue i.e. that new features in dependencies can cause mypy to fail.

A5rocks force-pushed the ignore-new-features branch from dd534bf to 0a7f41f Compare August 22, 2026 04:52

A5rocks commented Aug 22, 2026
edited
Loading

Copy link
Copy Markdown
Collaborator Author

I would be happy to explain more about the root cause, especially since I never actually made an issue particular to it, but essentially Trio has a lockfile (https://github.com/python-trio/trio/blob/main/test-requirements.txt) that conditionally has newer Sphinx versions that use new typing features. In particular, when I develop locally with my 3.14 Python, after a uv pip install <lockfile>, I get this:

a5rocks@whimsy ~/D/trio> uv run mypy
.venv/lib/python3.14/site-packages/sphinx/util/typing.py:29: error: Type statement is only supported in Python 3.12 and greater  [syntax]
Found 1 error in 1 file (errors prevented further checking)

and this has bothered me forever :-)

This comment has been minimized.

A5rocks force-pushed the ignore-new-features branch from 0a7f41f to 8187c82 Compare August 22, 2026 05:24

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python-version based syntax checks should not block

1 participant


Back | FazBrowse Home | New Git URL