Path: csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod From: Drew Parsons Newsgroups: linux.debian.bugs.dist,linux.debian.maint.python Subject: Bug#971573: RFP: python-cppimport -- import C or C++ files directly from Python Date: Fri, 02 Oct 2020 04:30:02 +0200 Message-ID: X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Fri Oct 2 02:21:10 2020 Old-Return-Path: X-Spam-Flag: NO X-Spam-Score: -4.2 Reply-To: Drew Parsons , 971573@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: debian-python@lists.debian.org, wnpp@debian.org X-Debian-Pr-Message: report 971573 X-Debian-Pr-Package: wnpp X-Spam-Bayes: score:0.0000 Tokens: new, 24; hammy, 150; neutral, 56; spammy, 0. spammytokens: hammytokens:0.000-+--H*M:reportbug, 0.000-+--H*MI:reportbug, 0.000-+--H*x:reportbug, 0.000-+--H*UA:reportbug, 0.000-+--X-Debbugs-Cc X-Originating-IP: 203.59.251.67 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: reportbug 7.7.0 X-Debian-Message: from BTS X-Mailing-List: archive/latest/1625718 List-ID: List-URL: Approved: robomod@news.nic.it Lines: 37 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Fri, 02 Oct 2020 10:16:52 +0800 X-Original-Message-ID: <160160501258.670007.7272025647870354375.reportbug@monte.emerall.com> Xref: csiph.com linux.debian.bugs.dist:1027267 linux.debian.maint.python:12908 Package: wnpp Severity: wishlist X-Debbugs-Cc: debian-python@lists.debian.org * Package name : python-cppimport Version : 17.09.18 Upstream Author : Ben Thompson * 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.