-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add a deprecation warning for unsupported Qt
versions and bindings (at least Qt4
: PyQt4
and PySide
)
#261
Comments
Seems like a good idea, and would presumably be a simple However, this does raise some important UX questions for us to consider (maybe I'm overthinking this 😆 ):
|
Thanks @CAM-Gerlach for checking on this and giving some suggestions! From my side I would say: Point 1 - Point 2 - Tha validation: I will say both since we should cover all usages of Qt4 that will not be supported (either automatic detection or user defined variables). Point 3 - The message: A generic warning explaining that What do you think @ccordoba12 ? Also maybe @andfoy or @steff456 have some ideas regarding approaches to this? And also @CAM-Gerlach would you like to work on this? |
Sure, it should be simple to do, just a if block at the end of LEGACY_APIS = PYQT4_API + PYSIDE_API
if API in LEGACY_APIS or initial_api in LEGACY_APIS:
warnings.warn(
"A deprecated Qt4-based binding (PyQt4/PySide) was installed, "
"imported or set via the QT_API environment variable. "
"To ensure their applications are still supported in QtPy 2.0, "
"developers should ensure they don't depend upon, import or "
"set the QT_API env var to 'pyqt', 'pyqt4' or 'pyside'.",
DeprecationWarning,
) Ideally |
We might also want to consider a warning if a version of PyQt (e..g. < 5.9 or at least <5.6), and/or PySide2 (e.g. < 5.12) is used that would similarly be unsupported in QtPy 2.0.0. |
I think that sounds good, but lets wait to see what others think.
Thats true, yes, I would say that the acceptable minimum for PyQt could be >=5.9 (since is the lates version in the anaconda channel) but since there are some issues regarding scoped enums with that version for Python 3.6 and 3.7 probably at the end the minimum will be something like >=5.12 as with PySide2. However we need to further discuss this too |
Yeah, and at least previously that discussion was happening in #233 ; maybe that could be moved here (since my PR will close that one)? Here's the latest comment on there, for reference, my part in the discussion was about adding a run constraint to QtPy 2.0 for the PyQt/Qt versions affected, at least for the conda packages (not sure if there's a way to do so with pip), which would avoid users and applications (e.g. Spyder) pulling in a QtPy version they are incompatible with. |
Here we are checking the deprecation warning message for Qt4 (which should go only to the Probably at #233 we will reach a conclusion and then that should be reflected in a new PR and/or could potentially affect the PR you are working on for the CI and test support for PyQt6 and general improvements at #262 That makes sense to you @CAM-Gerlach ? |
Sorry if I was unclear. I assumed this issue was motivated by the fact that Qt4 binding support is removed in QtPy 2.0, untested and deprecated in QtPy 1.x, and EoL upstream. Since all three of these reasons are equally true for Qt5 <5.9/5.12 (the specifics of which are being discussed in #233 ), I thought it might make sense to consider warning for that here as well (considering I'd think we'd want to decide on that before you make a final QtPy 1.x release with this change). |
Ah yes that makes sense, will reword this issue then 👍 |
PyQt4
and PySide
Qt
versions and bindings (at least Qt4
: PyQt4
and PySide
)
I agree with that message but not worded in third person. I mean, I think it's clearer and sounds better in second person: warnings.warn(
"A deprecated Qt4-based binding (PyQt4/PySide) was installed, "
"imported or set via the QT_API environment variable. "
"To ensure your application is still supported in QtPy 2.0, "
"please should ensure it doesn't depend upon, import or "
"set the QT_API env var to 'pyqt', 'pyqt4' or 'pyside'.",
DeprecationWarning,
) |
Also @ccordoba12 you think that in the message we should add something regarding Qt5 ? (Like a minimum version) |
Yup you're right @ccordoba12 , good point. I only had it that way before because we had different messages for developers and users, and since @dalthviz wanted to mainly target the former, I eliminated that part but didn't reword it. Fixing an grammar/editing mistake, warnings.warn(
"A deprecated Qt4-based binding (PyQt4/PySide) was installed, "
"imported or set via the QT_API environment variable. "
"To ensure your application is still supported in QtPy 2.0, "
"please make sure it doesn't depend upon, import or "
"set the QT_API env var to 'pyqt', 'pyqt4' or 'pyside'.",
DeprecationWarning,
)
☝️ Since Qt bindings < 5.9-5.12 (per the discussion on #233 ) are also equally deprecated and no longer supported in QtPy 2.0, my suggestion was that we should also include those in this warning too. |
I think we can go with this message as it is @CAM-Gerlach |
Hi @CAM-Gerlach any chance you can work on this with the last message? I think it could be nice to do the 1.11.3 release soon so if you have some time to work on this or if it is ok for someone else to work on this let us know |
Sorry, this got lost in my queue somehow. Thanks for the reminder; I'll take care of it now. One thing, though—this and #281 / #280 were all milestoned on 1.11.3, but #281 also bumped the QtPy 1.x version to 1.12. Was the latter intentional and we should rename the milestone, or is the former still correct? Thanks. |
Agreed.
I don't think so because |
@ccordoba12 Oh, so we already warn on Qt <5.6 and/or <5.9? |
No, we don't. Perhaps we should warn about Qt < 5.9 because the oldest version we can test. |
That's what I was suggesting 😏 But we could do that in another PR, since #283 should be ready to go and its a bit less trivial to code. |
Checking again the comments, regarding the message for Qt 5 <5.9, that's going to be done by @CAM-Gerlach in a new PR, right? Should we reopen this issue and close it with the merge of that new PR? |
I think we should leave this message for QtPy 2.0
I'm not in favor of that. Instead, let's open a new issue and fix it with a new PR. This issue was about the Qt4 message. |
That also makes the most sense to me 👍 . I can open a new issue.
I'm not sure about that, but we can discuss that in the new issue. I'll try to compile the relevant bits from each of us there to get things started. |
Sorry, took a while as I had to take some calls from family members, but opened as #284 |
Thanks @CAM-Gerlach , don't worry and hope everything is going ok |
Yeah, thanks are going okay for now at the moment in that department, thanks 👍 |
Maybe could be worthy to release
1.11.3
with a depreciation warning:Qt4
(removedPyQt4
andPySide
support forv2.0.0
)Qt5
: Depending on what minimumQt5
and bindings versions we will support forv2.0.0
. Maybe5.9
(if we can make it work), but most probably5.12
The text was updated successfully, but these errors were encountered: