question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warn if using a deprecated and/or unsupported Qt 5 version

See original GitHub issue

Since #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:closed
  • Created 2 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
CAM-Gerlachcommented, Dec 1, 2021

Yes, I think that’s a good idea too.

Great, happy to help with that too; just ping me if/when that is decided and for what version.

1reaction
ccordoba12commented, Nov 30, 2021

we would want to add a DeprecationWarning for that on QtPy 2.x only

Yes, I think that’s a good idea too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Un-deprecate your Qt project - KDAB
This was done with a precise purpose: we wanted Qt users to discover if they were using deprecated APIs, and if so, let...
Read more >
Failure to compile Android application - gradle - Stack Overflow
FAILURE: Build failed with an exception. Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use...
Read more >
Emulator release notes - Android Developers
The emulator now prints a warning if unsupported options are passed to -prop (Only qemu.* props are supported). When building the emulator on...
Read more >
Project wizards: warn when using deprecated APIs in new ...
Project wizards: warn when using deprecated APIs in new projects As discussed at QtCS, almost none of our users know that they can...
Read more >
#767107 - Add coment field to metapackage - Debian Bug report logs
Package: lintian Version: 2.5.30 Lintian reports an error for depending on metapackages. One of them is qt5-default. Depending on it causes errors such...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found