Warn if using a deprecated and/or unsupported Qt 5 version
See original GitHub issueSince #261 was implemented in PR #283 , we’re now issuing a DeprecationWarning
for QtPy 1.x when used with Qt versions and bindings that are deprecated, untested in QtPy 1.x, and unsupported in QtPy 2.0.
Given Qt/PyQt versions <5.9 and Pyside2 versions <5.12 are equally deprecated, untested in QtPy 1.x and officially unsupported in QtPy 2.0 (since we’ve removed any compat code for them, AFAIK), it would seem to make sense to issue an equivalent DeprecationWarning
in QtPy 1.x for that case as well.
Furthermore, we might want to elevate the warning to a UserWarning
or a PythonQtError
in QtPy 2.0, given that serious runtime breakage may occur, just as we currently do in 2.0 for the Qt 4 bindings, so users see it up front rather than having things mysteriously break later.
Depending on what is decided in #233 or elsewhere for future QtPy 2.0 versions going forward, we could also consider introducing a DeprecationWarning in QtPy 2.0 for PyQt <5.12 in that version, if in #233 it is decided to that be our support target for future follow-on versions. However, if that’s not immediately decided or out of scope here, that could be punted again to another followup issue.
Relevant conversation history on #261:
I said
We might want to consider a warning if a version of PyQt (e…g. < 5.9 or < 5.12), and/or PySide2 (e.g. < 5.12) is used that would similarly be unsupported in QtPy 2.0.0, and untested in recent QtPy 1.x.
@dalthviz said
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
I said:
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).
@dalthviz said
Ah yes that makes sense, will reword this issue then 👍
I said
@ccordoba12 Oh, so we already warn on Qt <5.6 and/or <5.9?
@dalthviz said
Also @ccordoba12 you think that in the message we should add something regarding Qt5 ? (Like a minimum version)
I said
point_up 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.
@ccordoba12 said
I don’t think so because qtpy takes care of that for the user.
I said
@ccordoba12 Oh, so we already warn on Qt <5.6 and/or <5.9?
@ccordoba12 said
No, we don’t. Perhaps we should warn about Qt < 5.9 because the oldest version we can test.
@dalthviz said
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?
@ccordoba12 said
I think we should leave this message for QtPy 2.0
I said
I’m not sure about that, but we can discuss that in the new issue.
_Originally posted by @CAM-Gerlach in https://github.com/spyder-ide/qtpy/issues/261#issuecomment-952260141_
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (12 by maintainers)
Top GitHub Comments
Great, happy to help with that too; just ping me if/when that is decided and for what version.
Yes, I think that’s a good idea too.