Hi all,
Just to give you all a heads-up, we now use QtPy in the latest developer version of glue to abstract away the differences between PyQt4, PyQt5, and PySide (instead of a custom module called qt-helpers). This means that imports such as:
from glue.external.qt import QtGui
will no longer work from glue 0.9 onwards. Instead, we need to do e.g.:
from qtpy import QtGui
QtPy follows the PyQt5 API, which is different from qt-helpers, which followed the PyQt4 API. Therefore, there will be some changes - for instance, the default widgets are now in QtWidgets instead of QtGui.
If you are importing from glue.external.qt in a plugin, you therefore will need to do something like:
try:
from glue.external.qt.QtGui import QMessageBox
except ImportError:
from qtpy.QtWidgets import QMessageBox
The glue.external import should come first for now, since its presence is a sure indication that you are using an old version of glue, whereas a user could happen to have qtpy installed at the same time as an old version of glue.
In addition, you will need to make sure you include QtPy in the dependencies if you are using e.g. Travis. QtPy is easy to install, but note that the version in the defaults conda channel is too old. If you want to use conda, install QtPy from the conda-forge channel:
conda install -c conda-forge qtpy
Note that you can also just:
pip install qtpy
since it is just a lightweight Python package.
If anyone has any issues with updating plugins, or if you run into any issues in the latest version of glue that you think might be related to this, just open an issue!
Thanks,
Tom