Bug#966052: spyder-kernels: Uses old name of sip module

2021-01-29 Thread Drew Parsons
Source: spyder-kernels
Followup-For: Bug #966052

spyder-kernels' use of sip is conditional to having environment
variable QT_API='pyqt', corresponding to PyQt 2 as I understand it.
It is only referenced in spyder_kernels/customize/spydercustomize.py
(lines 170, 172)

So it will not be accessed in a PyQt5 environment (where QT_API is not
set to 'pyqt').

spyder-kernels 1.10.1 applies other tests for PyQt5, but using
PyQt5.QtWidgets not .sip.

I think we don't need to patch anything in spyder-kernels. It's
already accounting for PyQt5. I think we can close this bug.



Bug#966052: spyder-kernels: Uses old name of sip module

2020-07-22 Thread Dmitry Shachnev
Source: spyder-kernels
Version: 1.5.0~really0.5.2-1
Usertags: sip5

Dear Maintainer,

You are receiving this bug because your package seems to be using PyQt5
and has Python files with "import sip" lines.

With the latest version of PyQt5 in experimental, the private sip module
used by PyQt5 is called "PyQt5.sip", not just "sip". I am going to upload
this version to unstable around end of August.

You may need to update your imports to do something like this:

try:
from PyQt5 import sip
except ModuleNotFoundError:
import sip

Alternatively, you may import sip after importing PyQt5. So the following
will work too:

from PyQt5 import QtCore
import sip

Please see the following link for details:

https://www.riverbankcomputing.com/static/Docs/PyQt5/incompatibilities.html#importing-the-sip-module

If you use sip for reasons unrelated to PyQt5, you may leave the old import
as is, but please bear in mind that sip4 is deprecated.

Also, calls like "sip.setapi('QDate', 2)" are not needed at all with PyQt5.
They were needed only with PyQt4 and Python 2. It is safe to delete them.

For the actual documentation of sip module, see the following link:

https://www.riverbankcomputing.com/static/Docs/PyQt5/api/sip/sip-module.html

--
Dmitry Shachnev


signature.asc
Description: PGP signature