Repository navigation
chore: stricter mypy - #2053
chore: stricter mypy#2053
Conversation
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
86280bf to
c18f9df
Compare
| - nox | ||
| - packaging | ||
| - pygithub | ||
| - pytest |
There was a problem hiding this comment.
Does having so many non pinned dependencies do not make pre-commit mypy fragile?
There was a problem hiding this comment.
A little (though pytest isn't too bad). Though generally if something changes we just adapt to the change.
Pre-commit doesn't have a way to pin these. Maybe eventually uv will.
There was a problem hiding this comment.
Pre-commit doesn't have a way to pin these. Maybe eventually uv will.
What did you mean by uv will? pre-commit.ci do not allow to pass any constraints.
The only possible way that I see is to have own CI job to bump constraints.
There was a problem hiding this comment.
I mean if uv adds multiple independent locked environments (and tasks), we could use that to move this check to uv.
There was a problem hiding this comment.
in napari (https://github.com/napari/napari) we use uv to compile a constraints file and call it from tox.
Maybe the same approach could be used here?
There was a problem hiding this comment.
If this becomes too much of a problem, we could probably do something (setting it up with nox would be easy). But for now it's fine, and long term we might end up moving from mypy to red-knot anyway.
I was looking at updating #1873 (and I realized it would be better to wait till after #1912) and I noticed we weren't very sensitive to updating things like
util.call->utils.cmd.callin our tests; I'd expect mypy to be able to detect all these without wasting time to run things. I also noticed this in #2048, where the tests weren't noticing the change toenable. These improvements should get proper mypy "coverage" of our tests. We still don't have 100% typing for arguments, but things like not allowing untyped function calls should require helper functions fully typed.