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

fix: set QT_API to pyside6 or pyside2 for deadline-cli #284

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

epmog
Copy link
Contributor

@epmog epmog commented Apr 3, 2024

What was the problem/requirement? (What/Why)

If a user has PyQt5/6 installed in their environment, launching the gui from the deadline client cli will throw an error saying TypeError: 'f' is an unknown keyword argument. This is because PyQt5/6 does not define f as a keyword arg in the QDialog constructor, even though Qt, PySide2, and PySide6 do.

This error will occur even if PySide6 or PySide2 are in the environment.

What was the solution? (How)

For now, set the QT_API environment variable to use/prioritize our supported Qt bindings.

ref: https://github.com/spyder-ide/qtpy/tree/master?tab=readme-ov-file#requirements

Can always add PyQt5/6 support in the future if needed.

What is the impact of this change?

Users with additional dependencies in their environment will continue to work!

How was this change tested?

Before the fix:

hatch shell
pip install PyQt5 PySide6
deadline config gui

received this error, since f is not a keyword for a QDialog in PyQt5/6

image

After fix without changing environment:

deadline config gui

And the gui launched properly

Was this change documented?

N/A

Is this a breaking change?

Nope


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@epmog epmog requested a review from a team as a code owner April 3, 2024 19:12
@epmog epmog added the bug Something isn't working label Apr 3, 2024
src/deadline/client/ui/__init__.py Show resolved Hide resolved
@epmog epmog merged commit e6ca757 into mainline Apr 3, 2024
15 checks passed
@epmog epmog deleted the set_qt_api_for_cli branch April 3, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants