Skip to content

Enable Mypy strict mode - #9803

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

Enable Mypy strict mode#9803
akx wants to merge 4 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.

@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.

@akx
akx force-pushed the strict-typing-v2 branch from 52a7a80 to 35af1ef Compare July 22, 2026 05:34
@radarhere radarhere mentioned this pull request Jul 27, 2026
@akx akx mentioned this pull request Jul 29, 2026
@akx
akx force-pushed the strict-typing-v2 branch from cc0b191 to 0c2f232 Compare August 10, 2026 18:45
jorenham and others added 2 commits August 12, 2026 17:11
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 0c2f232 to 20615d7 Compare August 12, 2026 14:11
@akx
akx force-pushed the strict-typing-v2 branch from 9d6a2b9 to 4ce1298 Compare August 12, 2026 14:13
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