Skip to content

Enable Mypy strict mode#9803

Open
akx wants to merge 3 commits into
python-pillow:mainfrom
akx:strict-typing-v2
Open

Enable Mypy strict mode#9803
akx wants to merge 3 commits into
python-pillow:mainfrom
akx:strict-typing-v2

Conversation

@akx

@akx akx commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Rebase of #9410, with the type fixes reduced to the minimum required to make uvx --python=3.11 --with-requirements=.ci/requirements-mypy.txt mypy conftest.py selftest.py setup.py checks docs src winbuild Tests pass. Most of the conflicts there were post f80b914 merge.

Closes #9410.

jorenham and others added 2 commits July 20, 2026 15:43
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
Co-authored-by: Aarni Koskela <akx@iki.fi>
@akx
akx force-pushed the strict-typing-v2 branch from 372de56 to 9b1659a Compare July 20, 2026 12:44
@akx
akx marked this pull request as ready for review July 20, 2026 12:44
@radarhere

radarhere commented Jul 20, 2026

Copy link
Copy Markdown
Member

Given that this is considerably smaller than #9410, I suspect you're only fixing the strict mode problems that arose testing against Python 3.11.

#9410 had its sights set a bit higher - it actually wanted to correct strict mode problems for newer versions of Python as well, which fell into an unresolved debate about whether to test against those versions or not.

But that isn't necessarily something to stop this PR from being merged. I just suspect it doesn't exactly replace #9410.

@akx

akx commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Same result on all supported Pythons.

$ for py in 3.11 3.12 3.13 3.14; uvx -q --python=$py --with-requirements=.ci/requirements-mypy.txt mypy conftest.py selftest.py setup.py checks docs src winbuild Tests; end
Success: no issues found in 303 source files
Success: no issues found in 303 source files
Success: no issues found in 303 source files
Success: no issues found in 303 source files
$

@radarhere

Copy link
Copy Markdown
Member

radarhere@cfb3ab8 added to these changes gives failures on 3.12 - 3.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants