Add support for SIP v5
- SIP v5 was released in October 2019.
- Since December 2019, the official PyQt5 packages on PyPI are built with it.
- Some distros, e.g. ArchLinux, are now building PyQt5 with SIP v5 too.
In SIP v5, there are several major changes that affect Krita:
- There is no more
sipconfig
Python module. In fact, it was deprecated since at least June 2014. There is a newsipbuild
module, but it has a completely different API.- I have removed
FindSIP.py
, and changedFindSIP.cmake
to look at the executable rather than the Python module. Some variables we got fromFindSIP.py
were not really used, so I removed them.
- I have removed
- The program name is
sip5
instead ofsip
. To be more precise, “sip5 is a drop-in replacement for the sip code generator included with SIP v4”.- The code supports both names now, with
sip5
being preferred.
- The code supports both names now, with
- There is no more
sip.h
file in Python include path.- I added a call to
sip-module
which generatessip.h
in the current directory.
- I added a call to
- When PyQt5 is built with SIP v5, its
.sip
files are installed to a different location, like/usr/lib/python3/dist-packages/PyQt5/bindings/
.- I copied the logic from sip itself, with a fall back to previous location if the new one does not exist.
Test Plan
I tested the following things (thanks to @pino who suggested that):
-
Settings
→Configure Krita
→Python Plugin Manager
has 15 items. Clicking on each shows the description/help for it. - A simple script
Tools
→Scripts
→Ten brushes
works. - A simple docker
Settings
→Dockers
→Recent documents
works.
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. -
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) - I am asking for help here :) I guess the relevant tests are in
plugins/python
, how to run them?
- I am asking for help here :) I guess the relevant tests are in
-
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.