-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
TYP: Run pyright_cov
in CI, enforce minimum type completeness of 80%
#29065
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we already use basedpyright for this? It has some additional inference and narrowing features that might be helpful here, e.g.
https://docs.basedpyright.com/latest/benefits-over-pyright/improved-generic-narrowing/. And if I understand correctly, then its baseline feature could be used as an alternative to --exclude-like
.
It might be possible to replace this with `basedpyright` | ||
https://github.com/DetachHead/basedpyright/issues/125 in the future. | ||
""" | ||
from __future__ import annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed?
Maybe it would be nice if we could have the CI complain if the % drops as a consequence of the changes? Although I'm not sure what the best way to implement something like that 🤔. |
@@ -72,3 +72,8 @@ jobs: | |||
- name: Run Mypy | |||
run: | | |||
spin mypy | |||
- name: Check Pyright's type compelteness is above 80% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Check Pyright's type compelteness is above 80% | |
- name: Check Pyright's type completeness is above 80% |
sure but wouldn't we need DetachHead/basedpyright#125 to be closed first? |
No, |
As discussed on Slack: https://numpy-team.slack.com/archives/C01BZCJ6NJ0/p1748280881632649
The idea is to prevent Pyright's type compeleteness from suddenly regressing - if it did, it would indicate an incorrect type (as was fixed in #28908)