-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-109413: Run mypy on libregrtest
in CI
#112558
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
Conversation
AlexWaygood
commented
Nov 30, 2023
•
edited
Loading
edited
- Fix remaining mypy errors
- Add a CI check to stop typing issues from regressing in the future
- Issue: libregrtest: Improve type hints; explore running mypy in CI #109413
libregrtest
in CIlibregrtest
in CI
self.testsuite_xml: list[str] = [] | ||
self.testsuite_xml: list = [] |
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 annotation is incorrect; leaving it as it is causes mypy to issue 5 or so errors in various places. We should correct the annotation, ideally, but for now making it more vague gets rid of the errors from mypy. I prefer to defer fixing it properly to a future PR, for now.
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.
For the new stuff that mypy doesn't know about, can they be ignored via mypy.ini?
If so, that would be cleaner, no need to temporarily add the extra comments in py files.
Otherwise looks good.
Co-authored-by: Hugo van Kemenade <[email protected]>
I don't think so, unfortunately :( Mypy's config supports ignoring all errors in a file, or ignoring all errors of a certain category in a file. But I don't think there's a config-file option to ignore all errors due to specific functions or parameters not existing, unfortunately :/ (And, to be fair, that comes up more in CPython than elsewhere! We're literally writing the stdlib here, after all 😄) |
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.
LGTM. These changes seem reasonable to me.
Thanks both! |
GH-112605 is a backport of this pull request to the 3.12 branch. |
(I'm not actually backporting the change to the |
Thanks for enabling mypy on libregrtest :-) |
…ythonGH-112558 (pythonGH-112605) (cherry picked from commit acc62db) Co-authored-by: Alex Waygood <[email protected]>
…GH-112558 (GH-112605) (#112607) [3.12] gh-109413: libregrtest: Backport `.py`-file changes from GH-112558 (GH-112605) (cherry picked from commit acc62db) Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>