Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #12908 > unrolled thread

Bug#971573: RFP: python-cppimport -- import C or C++ files directly from Python

Started byDrew Parsons <dparsons@debian.org>
First post2020-10-02 04:30 +0200
Last post2020-10-02 04:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.debian.maint.python


Contents

  Bug#971573: RFP: python-cppimport -- import C or C++ files directly from Python Drew Parsons <dparsons@debian.org> - 2020-10-02 04:30 +0200

#12908 — Bug#971573: RFP: python-cppimport -- import C or C++ files directly from Python

FromDrew Parsons <dparsons@debian.org>
Date2020-10-02 04:30 +0200
SubjectBug#971573: RFP: python-cppimport -- import C or C++ files directly from Python
Message-ID<AViZA-4Kt-1@gated-at.bofh.it>
Package: wnpp
Severity: wishlist
X-Debbugs-Cc: debian-python@lists.debian.org

* Package name    : python-cppimport
  Version         : 17.09.18
  Upstream Author : Ben Thompson <t.ben.thompson@gmail.com>
* URL             : https://github.com/tbenthompson/cppimport
* License         : MIT
  Programming Lang: Python
  Description     : import C or C++ files directly from Python

Sometimes Python just isn't fast enough. Or you have existing code in
a C++ library.  cppimport combines the process of compiling and
importing an extension in Python so that you can type modulename =
cppimport.imp("modulename") and not have to worry about multiple
steps.

cppimport looks for a C or C++ source file that matches the requested
module. If such a file exists, the file is first run through the Mako
templating system. The compilation options produced by the Mako pass
are then use to compile the file as a Python extension. The extension
(shared library) that is produced is placed in the same folder as the
C++ source file. Then, the extension is loaded.

Most cppimport users combine it with pybind11, but you can use a range
of methods to create your Python extensions. Raw C extensions,
Boost.Python, SWIG all work.




cppimport is used in some dolfinx tests.



Probably best maintained under the Debian Python Team.

[toc] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web