Testing #269

Feature #285: decide about Python binding

PythonAPI: prepare set of C++/Python binding examples using SIP

Added by pospelov almost 7 years ago. Updated almost 7 years ago.

Status:RejectedStart date:25 Apr 2013
Priority:NormalDue date:
Assignee:-% Done:

10%

Category:-
Target version:-

History

#1 Updated by pospelov almost 7 years ago

  • Status changed from Backlog to Sprint

#2 Updated by pospelov almost 7 years ago

  • Target version set to Sprint 13

#3 Updated by pospelov almost 7 years ago

  • Assignee set to pospelov

#4 Updated by pospelov almost 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.

Advantage of SIP in comparison with boost-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)
Disadvantage of SIP in comparison with boost-python
  • *.sip files have to be manually created and supported. No way of automatic code generation as in the case of boost's Py++
Other differences (good or bad is not clear)
  • 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.

#5 Updated by pospelov almost 7 years ago

  • Target version deleted (Sprint 13)

#6 Updated by pospelov almost 7 years ago

  • Assignee deleted (pospelov)

#7 Updated by pospelov almost 7 years ago

  • Status changed from Sprint to Backlog

#8 Updated by wuttke almost 7 years ago

  • Parent task set to #285

#9 Updated by wuttke almost 7 years ago

  • Status changed from Backlog to Rejected

SIP seems not to be the elegant solution we were hoping for.

See #285: we stay with boost::python and Py++ until an alternative is proven viable.

Also available in: Atom PDF