Feature #285: decide about Python binding
PythonAPI: prepare set of C++/Python binding examples using SIP
|Status:||Rejected||Start date:||25 Apr 2013|
#4 Updated by pospelov about 7 years ago
- % Done changed from 0 to 10
I have prepared first binding example ex01_HelloWorld using SIP build system. In principle one have to implement another 11 examples from boost-python collection of examples to see how difficult it will be. Basing on ex01_HelloWorld example I can say following:
1) For every MyCLass.h user wants to expose, special file MyClass.sip have to be provided. It contains duplicated code from MyClass.h patched with special SIP keywords.
2) User runs then some sip processor on top of all *.sip files to generate additional C++ code
3) Additional code is compiled together with main code to get shared library, which can be imported into python.
4) SIP is heavily integrated with pythod's distutils/setuptools build system. It looks like the expected way of compiling things in SIP powered project - is the compilation from python.
- compilation time of HelloWorld library is 3 times faster than in boost-python examples
- syntax of MyClass.sip is not complicated
- natural integration of custom C++ Qt widgets (exposed with SIP) with PyQt widgets (which are also SIP objects)
- *.sip files have to be manually created and supported. No way of automatic code generation as in the case of boost's Py++
- SIP project rely on python based C++ build system
So for the moment SIP looks good for me. However, amount of work for migration of the whole project to SIP, efforts for later support and overall benefits are not that evident.