-
-
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
New behavior when start import QtPy - setting Qt binding #156
base: master
Are you sure you want to change the base?
Conversation
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
packages:: | ||
|
||
>>> 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 |
Ok @dpizetta thanks for working on this and sorry for the late review! Please let us know |
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. |
Sure! will do :-) |
@goanpeca some new about this one? I think it is working properly, just the problem with the tests that seem not to be with the implementation here. If I could help more, please, let me know tks |
This PR restructure the mainly the init file, implementing new functions to help QtPy to get info about Qt API's.
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.