Switch from PyQt5 to PySide6#223
Conversation
Swap matplotlib Qt backend from qt5agg to qtagg and replace PyQt5 imports with PySide6 equivalents. Changes: - common.py, trc_filter.py, trc_plot.py: backend_qt5agg → backend_qtagg, PyQt5 → PySide6, exec_() → exec() - pyproject.toml: PyQt5 → PySide6
|
Thanks! I'll try to test it asap, but it might not be before the end of next week... I'll keep you posted! |
|
Not sure whether it is related or not, but it seems like there is a problem on Windows in the face_blurring utility script (smoke test: https://github.com/perfanalytics/pose2sim/blob/main/Pose2Sim/Utilities/face_blurring.py |
PySide6 requires a display server to import QtWidgets. Unlike PyQt5, it crashes on headless environments (e.g. GitHub Actions Ubuntu runners). Since common.py is imported by nearly every module, the top-level import broke all CLI entry points that never use a GUI. Move PySide6 and matplotlib Qt backend imports into plotWindow.__init__() so only code that actually creates a plot window needs a display.
|
It looks like PySide6 is causing a problem when getting imported during CI from common.py and the trc plot/fitter. It apparently has issues with a headless environment that PyQt5 was robust to. In the new commit to this PR, I moved the GUI imports from the top of the files into the initialization of the plot windows, so they won't get called during CI. Hopefully, this will also lighten up the import of common.py as the GUI will get lazy loaded only if it's really needed. All tests are green on my fork now... |
|
I had to run a clean install from a clean environment to make it work; otherwise I ran into some DLL issues. It is merged, however I'd like to merge the other pending pull request before pushing a new release. |
This PR replaces PyQt5 with PySide6.
I tested this before and after on my ubuntu machine. The PyQt5 version created some complications with cv2.imshow because I'm on wayland, but these didn't appear after the switch to PySide6. So hopefully in addition to aligning package dependencies, this will also streamline things for linux users.
Changes: