Fix types, introduce type tests#2562
Conversation
| cls: t.Type[CmdType] = ..., | ||
| *, | ||
| cls: t.Type[CmdType], |
There was a problem hiding this comment.
I think the same change should be made to group's third overload.
There was a problem hiding this comment.
Sure, but I think it's going to be up to the community to fill out the tests and fix the fallout. This PR is mainly to set up the infrastructure for it.
|
We were also using Should this be used instead of #2559? |
I've added |
I've added it. Looks like it prints out a bunch of stuff and succeeds. |
|
Is this ready to be merged? |
|
Yes, I just need to find some time, busy with regular job. |
for more information, see https://pre-commit.ci
e06f2ef to
d3fc283
Compare
|
I've switched from installing and using nodenv directly to installing the pyright package from PyPI. This allows us to pin the pyright version the same as mypy. I prefer to pin these tools because new versions regularly cause our tests to fail, which is confusing to contributors making PRs. (That said, the failures are usually nice things like being able to remove ignore comments.) Everything seems to work still, but let me know if there was a specific reason for using nodenv directly. |
|
Cool, thanks for the tip. I've actually borrowed this code from attrs, I'm not a pyright expert or anything. Maybe @hynek has an opinion? |
Fix signatures, introduce simple tests.
I followed the Flask model for typing tests. Initially I was going to replicate the attrs model (https://github.com/python-attrs/attrs/blob/main/tests/test_mypy.yml) but maybe this is good enough to start?
Also introduced Pyright tests, again copied from attrs.