-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Added pyautogui stubs #8654
Added pyautogui stubs #8654
Conversation
This comment has been minimized.
This comment has been minimized.
I don't understand the 1 failing test |
To silence the CI errors, you need to create a folder |
This comment has been minimized.
This comment has been minimized.
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.
Thank you! Here's a partial review -- I've got up to line 75 in __init__.pyi
, will carry on later if somebody else doesn't beat me to it :)
pyrightconfig.stricter.json
Outdated
@@ -90,7 +90,8 @@ | |||
"stubs/tzlocal/tzlocal/utils.pyi", | |||
"stubs/ttkthemes", | |||
"stubs/urllib3", | |||
"stubs/vobject" | |||
"stubs/vobject", | |||
"stubs/PyAutoGUI" |
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.
Nit: can we keep this list alphabetised? :)
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.
We could edit the stub generating script to keep it alphabetized. Alphabetizing would also help prevent merge conflicts: if two new items are added to the end, they will conflict, but if they are added to a random-ish place depending on the name of the project, they won't.
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.
We could edit the stub generating script to keep it alphabetized.
I like that idea :)
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.
(Actually, it looks like the stub-generating script already has logic in it to keep the list alphabetised. I'm guessing the only reason it wasn't initially alphabetised here is because of the path-separator issue being discussed in #8653, which screwed up the alphabetisation logic. So I think this issue will be fixed when #8653 is merged.)
This comment has been minimized.
This comment has been minimized.
I ran stubtest locally so it could tell me about missing class members without the display error. Edit: I found the pointer types in ctypes.wintypes |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Here's a review for the rest of the PR!
As well as the remarks inline here: we usually only add stubs for a package's public API, unless there's a good reason to add stubs for implementation details. That means we usually omit stubs for private modules like _pyautogui_osx.pyi
, _pyautogui_java.pyi
, _pyautogui_win.pyi
and _pyautogui_x11.pyi
. Would you mind removing those? (Add an allowlist entry if stubtest complains!)
The remarks I made in relation to the mouseDown()
signature also apply to mouseUp()
, click()
, leftClick()
, rightClick()
, middleClick()
, doubleClick()
, tripleClick()
, scroll()
, hscroll()
, vscroll()
, moveTo()
, moveRel()
, dragTo()
and dragRel()
.
The remarks I made in relation to press()
also apply to hold()
and typewrite()
.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Thank you!
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
No description provided.