Skip to content

Refactor selection of Qt binding (prefer pyqt5)

Carlos Pascual requested to merge github/fork/cpascual/qt5default into develop

Currently, if taurus.external.qt is imported and no Qt binding is already imported, Taurus falls back to selecting a binding based on the QT_API env var or, in its absence, the value of tauruscustomsettings.DEFAULT_QT_API. But these variables are used only as hints, and if their selection cannot be imported, the next bindings in the internal list are tried.

Change this behavior by introducing the possibility of setting these variables to an empty string to indicate that Taurus should try available bindings. If the value is not empty, then a failure to import the indicated binding is considered an error and an exception is thrown (instead of trying other bindings).

Also, change the order in which the bindings are tried, to: pyqt5, pyqt, pyside2, pyside (up to now, pyqt4 was tried before pyqt5)

This PR provides unit tests for the selection feature

Merge request reports