Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check types with mypy #7622

Merged
merged 3 commits into from
Dec 20, 2023
Merged

Check types with mypy #7622

merged 3 commits into from
Dec 20, 2023

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Dec 18, 2023

Helps #2625.

Run mypy to check type hints:

tox -e mypy

Some good advice here:

So let's start off small with just the src directory, and exclude lots of files with warnings, currently 61, so it's running on 34 to begin with.

This adds some fairly lenient settings (happy to tweak them now and later), notably follow_imports = "silent".

When mypy encounters an import, it also checks the imported file, and its imports. They recommend using the default "normal", but lots of things import others which aren't ready yet, so let's change it when we can.

@hugovk hugovk added the Testing label Dec 18, 2023
tox.ini Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@hugovk
Copy link
Member Author

hugovk commented Dec 19, 2023

Rebased after #7624, and removed 44 files from the exclude, it now checks 76 files!

tox.ini Show resolved Hide resolved
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@radarhere radarhere merged commit e2c9e33 into python-pillow:main Dec 20, 2023
56 checks passed
@hugovk hugovk deleted the add-mypy branch December 20, 2023 07:22
@radarhere radarhere mentioned this pull request Feb 18, 2024
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.

2 participants