-
Notifications
You must be signed in to change notification settings - Fork 82
switch to qtpy - qt-api "agnostic" qt-python-bindings #333
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
Conversation
* change all `PyQt5` import to `qtpy` * change use of `qApp` to `QApplication.instance()` (doesn't exist in pyside) * `PyQt5.QtCore.pyqtSignal` -> `qtpy.QtCore.Signal` * `PyQt5.QtCore.pyqtSlot` -> `qtpy.QtCore.Slot` * `sip.isdeleted` -> `not qtpy.compat.isalive` * small gymnastics for `QUndoStack` which is not agnostic to the in binding `qtpy`: (PyQt5, PySide2): `QtWidgets`; (PyQt6, PySide6): QtGui
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #333 +/- ##
==========================================
+ Coverage 36.30% 36.33% +0.02%
==========================================
Files 108 108
Lines 11424 11434 +10
==========================================
+ Hits 4147 4154 +7
- Misses 7277 7280 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tried this together with the ilastik PR and seems ok I guess? Are you still planning changes? |
really don't understand why the tests in the conda recipe time out... Update: Seems to be a problem with cleaning up threads in the tests - I could not get to the root cause (I assume some changes in python) that would result in hangs when one of the tests was trying to Added a fixture, where the threadpool is used implicitly and cleaned up after every test. |
Not 100% sure about the root cause, but with Python 3.10, .join() on threads from the global renderer pool would cause hangs. This makes sure the tests that imageScene2D tests, clean up the render pool. Lazyflow thread pool seems not to be affected by this problem.
Tests green locally and sample projects load ok 👍 (ran with ilastik/ilastik#3068) |
In order to prepare enabling/switching to Pyside6 (qt6!) I propose to go via qtpy. This enables us to switch qt apis more flexibly. I already tested volumina with Pyside6. With this PR, this does not require any code changes (tested python 3.13 with pyside6). Note that the qt bindings with this pr are still PyQt5.
Summary:
PyQt5
import toqtpy
qApp
toQApplication.instance()
(doesn't exist in pyside)PyQt5.QtCore.pyqtSignal
->qtpy.QtCore.Signal
PyQt5.QtCore.pyqtSlot
->qtpy.QtCore.Slot
sip.isdeleted
->not qtpy.compat.isalive
QUndoStack
which is not agnostic to the inbinding
qtpy
: (PyQt5, PySide2):QtWidgets
; (PyQt6, PySide6): QtGuiNote: Should definitely be squash and merge for revertability.