Hi Jochen!

On Fri, Nov 05, 2021 at 09:13:14AM +0100, Jochen Sprickerhof wrote:
> Hi Dmitry,
>
> Agreed, this also affects src:ros-rviz, src:qgis and src:pyqwt3d, in
> #998561, #998567 and #998595. I didn't reassign the bugs as sip4 is
> deprecated.

Thank you for giving me a list of these bugs!

> The easy fix would be to revert the change in
>
> /usr/lib/python3/dist-packages/PyQt5/bindings/QtCore/QtCoremod.sip:23
>
> Alternatively we could add py_ssize_t_clean to the sip4 parser, see the
> attached patch.
>
> I've verified that both fix ros-rviz.

I prefer adding functionality to SIP 4 to removing the functionality from
SIP 6 or PyQt5.

So thank you for the patch, I have applied it to sip4 package and uploaded.

> Looking at
>
> https://udd.debian.org/cgi-bin/bts-usertags.cgi?user=mitya57%40debian.org&tag=sip5
>
> I guess we want to src:ros-rviz and src:qgis to the list.
> Do you have any documentation on how to port from sip4 to sip6?
> Esp how to do code generation like /usr/bin/sip with sip6.

Unfortunately there is no replacement for /usr/bin/sip. The recommended
way is to use the new sip-build tool, and two files to configure it:
pyproject.toml and project.py.

Here are some examples of porting:

- https://github.com/frescobaldi/python-poppler-qt5/pull/41
- https://github.com/GauiStori/PyQt-Qwt/pull/14
- https://github.com/qgis/QGIS/pull/45128
- https://github.com/kovidgoyal/calibre/commit/7a4b3f61ff24f8c3
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964127#51

You can also look at what QScintilla2 does, it is developed by the same
person as SIP and PyQt so it will always use the best practice:

https://www.riverbankcomputing.com/software/qscintilla/download

Alternatively, if your project is a complex one and has more than just
a SIP binding, you may use sipbuild Python API directly. I have some
examples of this too:

- https://github.com/veusz/veusz/pull/545
- https://github.com/wxWidgets/Phoenix/pull/1916

By the way, wxpysip.py with my patch from the last link is the best
approximation of old sip tool that I know of. But it is recommended to
use the sip-build tool because sipbuild API is not stable and breaks
from time to time.

--
Dmitry Shachnev

Reply via email to