-
-
Notifications
You must be signed in to change notification settings - Fork 70
Type annotation test #605
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: master
Are you sure you want to change the base?
Type annotation test #605
Conversation
src/pytestqt/qtbot.py
Outdated
@@ -13,6 +14,11 @@ | |||
CallbackCalledTwiceError, | |||
) | |||
|
|||
if TYPE_CHECKING: | |||
from qtpy.QtWidgets import QWidget |
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.
Does qtpy
provide useful types?
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.
I'm not sure we can provide useful types for Qt classes for now... as commented in #417 (comment), I would focus on typing non-Qt things for now and getting the infrastructure in place.
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.
Does
qtpy
provide useful types?
Qtpy provides all the expected classes and with some common API, mostly relying on conditional imports of the actual qt in your environment. This way I believe it would use whichever underlying qt that came from the testing matrix in 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.
I'm not sure we can provide useful types for Qt classes for now... as commented in #417 (comment), I would focus on typing non-Qt things for now and getting the infrastructure in place.
Would the precommit check be sufficient infrastructure? That way it runs locally as well as CI. Or shall I look into a separate CI linting stage?
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.
pre-commit is enough. 👍
No description provided.