-
-
Notifications
You must be signed in to change notification settings - Fork 163
New behavior when start import QtPy - setting Qt binding#156
New behavior when start import QtPy - setting Qt binding#156dpizetta wants to merge 35 commits intospyder-ide:masterfrom
Conversation
This PR restructure the mainly the init file, implementing new functions to help QtPy to get info about Qt API's.
- QtPy will always try 4 times (4 API's) if None is found.
- Add and improve warnings if changes and fails occurs.
- Help functions may be part of scripts to help developers in the future, ex.:
qtpy --available_api >> PySide, PyQt5
qtpy --api_info=PyQt5 >> APIVersion, QTVersion ...
More details about the new behavior are described in init documentation.
It passed tests locally, but some variables were changed in init file, that someone is using somewhere in other projects.
PYSIDE_VERSION > API_VERSION
Feel free to criticise and comment the code.
|
About CI errors, I can change the use of importlib.utils to try...import to avoid problems with py27. Waiting for your reviews :) Tks |
|
Those changes might be problematic, we would need to preserve names, and maybe add deprecation notices if we want to change this for 1.5, or even 2.x ? |
qtpy/__init__.py
Outdated
|
|
||
| >>> import os | ||
| >>> os.environ['QT_API'] = 'pyside2' | ||
| >>> os.environ['QT_API'] = 'PySide2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but I don't have much time right now to do a thorough review of this. For now, please revert this change you made here about using capitalization to set QT_API.
There's a well established convention among Python projects that deal with different Qt bindings to use QT_API as we are using it here, so please revert that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sorry for that, actually it was a find/replace that goes wrong. I will fix.
|
@dpizetta, I left an initial comment and also please fix the failures in our CIs (the best way you consider it) before we can start to review your work. |
|
The fail in CI for PySide2 maybe is caused by the low speed to download the wheels. I have this problem here too. The latest version is sadly very low to download. I have used latest-1 :) Maybe enable cache can help if not enabled. #159 |
|
The problems with pyside2 servers seem to be solved... https://bugreports.qt.io/browse/PYSIDE-684 :) |
|
@dpizetta, please rebase this one in top of master to fix the error in CircleCI. |
|
I forgot about this. Will review it :-) |
|
Hi guys, I would like to ask both of you @goanpeca and @ccordoba12 to wait for me to update this PR. I've also more ideas that can help this PR. Tks |
|
One genera comment is that if you want to use the QT_API to import something, I think is better to let QT_API = 'PySide2'
MAP = { 'pyside2': 'PySide2', ... } qt_api_module = MAP.get(QT_API.lower()) Thoughts @ccordoba12 ? |
|
Hi guys, any ideas for this problem in CI? Tks Also, is there any problem setting debug level for the logging in test mode? I think we get more info from the code - I put some in init. |
|
@goanpeca could give some help with those issues on CI's, both are in Python2.7 and related to the return of a function that returns -1 when compared to 1 (-1 == 1). Thanks. Later I'll solve the conflicts, so you can review the code. It should be working without any drastic API changes. |