chore(python): Bring Pyright's type completeness to 99.7%, enforce minimum 99% type coverage in CI#22965
Closed
MarcoGorelli wants to merge 2 commits intopola-rs:mainfrom
Closed
chore(python): Bring Pyright's type completeness to 99.7%, enforce minimum 99% type coverage in CI#22965MarcoGorelli wants to merge 2 commits intopola-rs:mainfrom
MarcoGorelli wants to merge 2 commits intopola-rs:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22965 +/- ##
==========================================
- Coverage 80.33% 80.32% -0.02%
==========================================
Files 1682 1682
Lines 223120 223114 -6
Branches 2804 2803 -1
==========================================
- Hits 179251 179223 -28
- Misses 43201 43223 +22
Partials 668 668 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #22962
The idea is to use
pyright --verifytypesto enforce type completeness across the libraryWith this change, it brings type completeness to 99.7%. Without it, we get
The remaining types reported as "partially unknown" are:
Unfortunately,
pyrightdoesn't give us a way to enforce minimum type completeness microsoft/pyright#10458, they suggested to make a tool which wraps Pyright and parses the output json. That's what I've done in pyright-covPotential alternatives:
pyright_cov.pyfile into the Polars repo. It's very simple, only ~50 lines long, nothing fancyI've been trying something similar in NumPy, and they've suggested BasedPyright - will take a look at that and then update numpy/numpy#29065 (comment)