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

feat: use qtpy and add support for pyside6 #202

Merged
merged 1 commit into from
Mar 22, 2024
Merged

Conversation

justinsaws
Copy link
Contributor

@justinsaws justinsaws commented Mar 11, 2024

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

We currently use Pyside2 for our GUI requirements (brought in by external applications) but want to be able to use pyside2, pyside6, or other qt-based runtimes (ie. whatever other applications may provide).

What was the solution? (How)

Switching to use QtPy allows us to abstract away the choice of which specific Qt bindings to use and makes switching a fairly seamless process.

The main changes here are:

  • add qtpy to pyproject
  • swap all pyside2 references to qtpy
  • add optional GUI deps. Invoked by pip install deadline[gui]
  • add the ability for the deadline cli to install gui deps at runtime by asking the user, regardless of the standard python or deadline executable
  • fix how we were creating signals to be pyside2/6 compatible
  • swap QRegExpValidator to QRegularExpressionValidator, since qtpy is missing that compatibility and the former is no longer available in pyside6, but the latter is available in both.
  • fix maximum recursion depth issue by removing deprecated exec_ references

There's still some clean-up that can be done, as evidenced by needing some mypy overrides.

What is the impact of this change?

  • user experience is greatly improved by having easy access to the GUI, even if they started with CLI
  • default gui experience with deadline cloud is now PySide6
  • Future Qt development should be simplified
  • we can support GUIs on python 3.11 or later
  • we can support GUIs on macOS arm

How was this change tested?

Standard tests

hatch run fmt
hatch build
hatch run lint
hatch run test

Ran a few submitter workflows:

  1. Tested out the dev-gui and was able to interact with everything and submit jobs with no issue
  2. Installed PySide2 with the gui and it behaved the exact same way as PySide6
  3. Used it as a local dependency within Maya and Nuke and confirmed that it all still worked with no issue

I then performed manual testing around the installation workflow when a user doesn't have the optional gui dependencies available

  1. When using python with `pip install deadline[gui], confirmed that I was able to use the gui-submit option for job bundles.
  2. When using python with pip install deadline, confirmed that it prompted me to install PySide6. Subsequent launches did not ask me, as the dependencies were available.
  3. When using the deadline executable from pyinstaller, confirmed that it prompted me to install PySide6 using the python available on my path. Subsequent launches did not ask me, as the dependencies were available.
  4. When using the deadline executable from pyinstaller AND without having python3 or python on the path, confirmed that it prompted me to install and gave me a command that I could manually run with a python install that worked. Subsequent launches did not ask me, as the dependencies were available.
Optional GUI components for deadline are unavailable. Would you like to install PySide? [y/N]: y
Unable to install GUI dependencies, if you have python available you can install it by running:

	python -m pip install 'PySide6-essentials==6.6.*' --python-version 3.10 --only-binary=:all: -t /Users/epmog/deadline-cloud/deadline_pyinstaller/cli

deadline-cloud epmog$

Was this change documented?

N/A

Is this a breaking change?

No, all applications should continue to work since deadline now brings in qtpy by default (without any of the actual GUI deps)

@justinsaws justinsaws requested a review from a team as a code owner March 11, 2024 15:55
requirements-gui.txt Outdated Show resolved Hide resolved
@epmog epmog force-pushed the justins/swap_to_qtpy branch 14 times, most recently from 3ff462c to 396b49e Compare March 20, 2024 22:35
@ddneilson ddneilson changed the title chore: Switch Pyside references to use QtPy instead fix: Switch Pyside references to use QtPy instead Mar 21, 2024
ddneilson
ddneilson previously approved these changes Mar 21, 2024
@epmog epmog force-pushed the justins/swap_to_qtpy branch 3 times, most recently from 0e09dd3 to 8ed24cb Compare March 22, 2024 02:15
@epmog epmog changed the title fix: Switch Pyside references to use QtPy instead feat!: use qtpy instead of pyside2 Mar 22, 2024
@epmog epmog changed the title feat!: use qtpy instead of pyside2 feat!: use qtpy and optionally pyside6 instead of pyside2 Mar 22, 2024
@epmog epmog changed the title feat!: use qtpy and optionally pyside6 instead of pyside2 feat!: use qtpy and add support for pyside6 Mar 22, 2024
@epmog epmog force-pushed the justins/swap_to_qtpy branch from 8ed24cb to 529ef1d Compare March 22, 2024 02:18
@epmog epmog changed the title feat!: use qtpy and add support for pyside6 feat: use qtpy and add support for pyside6 Mar 22, 2024
@epmog epmog force-pushed the justins/swap_to_qtpy branch 2 times, most recently from 7fcefb9 to 9868481 Compare March 22, 2024 02:48
Copy link
Contributor

@ddneilson ddneilson left a comment

Choose a reason for hiding this comment

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

I'm really looking forward to being able to use this!

pyproject.toml Show resolved Hide resolved
Copy link
Contributor

@marofke marofke left a comment

Choose a reason for hiding this comment

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

This is awesome! My local workspace wasn't working with GUI stuff after upgrading my python version, but this got it working again after I pulled these changes locally.

Very slick experience to call:

deadline bundle gui-submit --browse

Have it prompt me to install pyside, and then continue with opening my file explorer to do the gui submit.

@epmog epmog force-pushed the justins/swap_to_qtpy branch from 9868481 to 2b089a3 Compare March 22, 2024 15:41
@epmog epmog merged commit deb2cca into mainline Mar 22, 2024
18 checks passed
@epmog epmog deleted the justins/swap_to_qtpy branch March 22, 2024 15:48
@epmog epmog mentioned this pull request Mar 23, 2024
baxeaz pushed a commit that referenced this pull request Mar 23, 2024
Signed-off-by: Justin Sawatzky <[email protected]>
Co-authored-by: Morgan Epp <[email protected]>
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.

4 participants