Skip to content

mypy in ci vs pre-commit #5307

Answered by keewis
raybellwaves asked this question in General
Discussion options

You must be logged in to vote

That's because pre-commit will create a new environment (using venv / virtualenv), which contains only mypy. This means that mypy can check for internal consistency, but the type hints of dependencies (e.g. numpy) won't be used to check compatibility with those (we would need a full environment for that).

pre-commit has the additional_dependencies setting which will install additional packages into the environment, but that's another list of dependencies which can easily get out-of-sync (and I at least didn't know about it when we added the separate mypy CI).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by keewis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants