Skip to content

[Pygments] Check for missing stubs outside omitted subpackages#15606

Merged
brianschubert merged 2 commits intopython:mainfrom
brianschubert:stubs-pygments-check-missing
Apr 4, 2026
Merged

[Pygments] Check for missing stubs outside omitted subpackages#15606
brianschubert merged 2 commits intopython:mainfrom
brianschubert:stubs-pygments-check-missing

Conversation

@brianschubert
Copy link
Copy Markdown
Collaborator

These stubs are basically complete, but ignore_missing_stubs = true was set back in #9779 due to there being a few deliberately omitted modules. This adds allowlist entries for those modules instead, and fixes a few inconsistencies that have accumulated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/highlighting.py:39: error: Unused "type: ignore" comment  [unused-ignore]
+ sphinx/highlighting.py:39:5: error: Cannot assign to a method  [method-assign]
+ sphinx/highlighting.py:39:5: note: Error code "method-assign" not covered by "type: ignore" comment
+ sphinx/highlighting.py:39:35: error: Incompatible types in assignment (expression has type "classmethod[Any, [Any], Any]", variable has type "Callable[[Any], GenericAlias]")  [assignment]
+ sphinx/highlighting.py:39:35: note: Error code "assignment" not covered by "type: ignore" comment

@brianschubert
Copy link
Copy Markdown
Collaborator Author

sphinx hit is a true positive. The affected line is already covered by a # type: ignore comment, but the error code changed now that Formatter.__class_getitem__ exists in the stubs.

https://github.com/sphinx-doc/sphinx/blob/cc7c6f435ad37bb12264f8118c8461b230e6830c/sphinx/highlighting.py#L39.

@brianschubert brianschubert merged commit 97d1089 into python:main Apr 4, 2026
39 checks passed
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