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
Add type stub file for @wrapt.decorator
#2442
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2442 +/- ##
=======================================
Coverage 96.92% 96.92%
=======================================
Files 104 104
Lines 9133 9153 +20
=======================================
+ Hits 8852 8872 +20
Misses 281 281 ☔ View full report in Codecov by Sentry. |
@wrapt.decorator
exclude = (?x)( | ||
docs| | ||
\.run| | ||
\.tox | ||
/docs/ | ||
| /\.run/ | ||
| /\.tox/ | ||
) |
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.
This corrects the paths to exclude when doing static type checking with mypy.
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.
Independent of the new stub file, correct?
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.
Correct, this is an independent change.
@@ -68,9 +66,6 @@ ignore_errors = true | |||
# gradually make PlasmaPy consistent with mypy's strict mode, we can | |||
# remove the disabled error codes file-by-file. | |||
|
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.
All of the changes in this file made below this line were done automatically, as described in #2424.
This PR is removing a lot of the mypy errors that we had been ignoring, while also uncovering some new errors for code that wasn't type checked because it depended on @wrapt.decorator
in some way.
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.
Sounds good - are there any other dependencies with the same problem/solution?
Thank you for the review!
Yes. Several. The most pressing and most difficult will be |
Description
This PR adds a type stub file for
wrapt
.Motivation and context
A few of our widely used decorators like
@particle_input
make use of@wrapt.decorator
. Becausewrapt
is untyped, we were running into issues with mypy not type checking some of our code because@wrapt.decorator
is untyped. Adding a type stub file lets us get past that. This also serves as a prototype type stub file.Related issues
This came up in #2429.