-
-
Notifications
You must be signed in to change notification settings - Fork 69
Integration with qtpy #184
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
Comments
Hi @rth, I wouldn't mind ditching the current API layer if Does My preference would be to completely remove the compatibility API and use |
Aww right, that's another challenge. No qtpy doesn't and expect explicit imports e.g. Though this would add one extra layer of indirection for the wrapper around the wrapper around Qt :/ |
There's already some discussion about this at #130 (comment) FWIW. |
|
Thanks for the pointer @machinekoder. But as commented in #130 (comment) it is probably not worth to use a wrapper, the qt_compat module provides lazy loading and doesn't really add too much to maintenance because we don't need to import the entire API anyway, just a few symbols. |
The support of multiple PyQt / PySide backends is a recurrent problem for any project working with Qt in Python. In pytest-qt it is solved by providing a compatibility
_QtApi
interface inqt_compat.py
(that is not in the public interface). At the same time there are packages that specialize in providing such a compatibility interface, namely spyder-ide/qtpy and mottosso/Qt.py. For project that use one of those packages (e.g. matplotlib is considering it), and wanting to test it with with pytest-qt it would mean that they would not, technically be testing the project in the same conditions (and it would also mean setting differently named environment variables twicePYTEST_QT_API
andQT_API
orQT_PREFERRED_BINDING
.)I think the integration could be straightforward: e.g. to integrate with qtpy, the following should almost work,
At the end of pytestqt/qt_compat.py
And maybe one extra environment in TravisCI for testing..
What do you think?
The text was updated successfully, but these errors were encountered: