-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add support for PyQt6 and PySide6 (<6.4) to Qt backends #2318
Conversation
@astrofrog I have added CI envs for PyQt6 and PySide6 in #2320 if you want to test those here. The setup is taken from the working one in glue-viz/echo#34; |
21f2b80
to
4a49674
Compare
5f37b34
to
8b75a0d
Compare
The PySide6 6.4 errors are due to spyder-ide/qtpy#373 |
Testing PySide6 6.4.0 with spyder-ide/qtpy#374 installed from from glue.viewers.matplotlib.qt.widget import MplWidget
../../opt/mambax86/envs/pyside6/lib/python3.10/site-packages/glue/viewers/matplotlib/qt/widget.py:13: in <module>
from matplotlib.backends.backend_qt5 import FigureManagerQT
../../opt/mambax86/envs/pyside6/lib/python3.10/site-packages/matplotlib/backends/backend_qt5.py:6: in <module>
from .backend_qt import ( # noqa
../../opt/mambax86/envs/pyside6/lib/python3.10/site-packages/matplotlib/backends/backend_qt.py:72: in <module>
_MODIFIER_KEYS = [
../../opt/mambax86/envs/pyside6/lib/python3.10/site-packages/matplotlib/backends/backend_qt.py:73: in <listcomp>
(_to_int(getattr(_enum("QtCore.Qt.KeyboardModifier"), mod)),
E TypeError: int() argument must be a string, a bytes-like object or a real number, not 'KeyboardModifier' There was a change in type from 6.3.2 type(PySide6.QtCore.Qt.KeyboardModifier.ControlModifier)
<class 'PySide6.QtCore.Qt.KeyboardModifier'> which supports type(PySide6.QtCore.Qt.KeyboardModifier.ControlModifier)
<enum 'KeyboardModifier'> which has no Matplotlib may need to define something like _to_int = operator.attrgetter("value") if QT_API in ("PyQt6", "PySide64") else int |
@dhomeier - thanks for investigating! Could you report that upstream to Matplotlib? |
@dhomeier - I think this is ready for now, happy to merge? (the pyside63 failure that is not an allowed failure is a non-deterministic error). |
Yes; I could get
so I'd also recommend to wait for the qtpy and matplotlib errors to be fixed, and then continue to work on PySide 6.4 support. I also noticed when launching pytest directly, I am getting the environment listing as glue: 0.1.dev6471+g2d83dd8
PYTHON
Python: INSTALLED (3.10.6)
GUI FRAMEWORK
PyQt5: NOT INSTALLED
PySide2: NOT INSTALLED
REQUIRED and so on, but no report on the PyQt6 and PySide6 installations; could not figure out where that printout is generated though. |
Should it not still be better in allowed_failures so as not to block the publish job? How about a more changelog-usable title like "Add support for PyQt6 and PySide6 backends"? |
Ah, mpl is already fixed in matplotlib/matplotlib#24158 (GH search is just performing very awkwardly)! |
Work in progress!