Skip to content
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

pyautogui: just skip stubtest #8678

Merged
merged 1 commit into from
Sep 3, 2022
Merged

pyautogui: just skip stubtest #8678

merged 1 commit into from
Sep 3, 2022

Conversation

AlexWaygood
Copy link
Member

I realised immediately after merging the pyautogui PR that there's not much point running stubtest on this package, since stubtest isn't able to import any of PyAutoGUI without access to a display screen

@github-actions

This comment has been minimized.

@AlexWaygood AlexWaygood closed this Sep 3, 2022
@AlexWaygood AlexWaygood reopened this Sep 3, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into whether we could fudge this with environment variables, but it really does need an actual display it can talk to at import time.

(Also, remind me not to try to install pyautogui on a Mac, it installs like 100 dependencies.)

@JelleZijlstra JelleZijlstra merged commit 8bc2565 into master Sep 3, 2022
@JelleZijlstra JelleZijlstra deleted the pyautogui-stubtest branch September 3, 2022 20:25
@Akuli
Copy link
Collaborator

Akuli commented Sep 4, 2022

We could use xvfb-run if we want an actual display. I do it for the tests of my GUI programs, e.g. https://github.com/Akuli/porcupine/blob/b4e3e0a0015af661bb4974b1ab200854ce638126/.github/workflows/check.yml#L55-L57

@AlexWaygood
Copy link
Member Author

We could use xvfb-run if we want an actual display. I do it for the tests of my GUI programs, e.g. https://github.com/Akuli/porcupine/blob/b4e3e0a0015af661bb4974b1ab200854ce638126/.github/workflows/check.yml#L55-L57

Interesting. Would this slow down running stubtest at all? Would there be a way of specifying in METADATA.toml whether a package needs a display, and then only using xvfb for packages that need it?

@Akuli
Copy link
Collaborator

Akuli commented Sep 4, 2022

It would slow starting stubtest, but only by about 300ms:

$ time xvfb-run sleep 1

real	0m1,341s
user	0m0,019s
sys	0m0,010s

Once stubtest is running, it has a DISPLAY environment variable but otherwise runs as usual.

@AlexWaygood
Copy link
Member Author

Sounds great to me, in that case!

@AlexWaygood
Copy link
Member Author

AlexWaygood commented Sep 4, 2022

Could we maybe unskip stubtesting pynput as well, if we did this?

skip = true # A display server (e.g. X11) is required to import pynput

@AlexWaygood
Copy link
Member Author

@Akuli, could you work up a PR for this? (GitHub Actions are... not my strong suit.)

@Akuli
Copy link
Collaborator

Akuli commented Sep 8, 2022

Sure. I'll probably get it done during this weekend :)

Akuli added a commit to Akuli/typeshed that referenced this pull request Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants