Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.maint.python > #12579
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Uwe Steinmann <uwe@steinmann.cx> |
| Newsgroups | linux.debian.maint.python |
| Subject | Re: Best practice on how to package a python module along with a c++ program |
| Date | Tue, 12 May 2020 14:20:01 +0200 |
| Message-ID | <A5C37-BT-5@gated-at.bofh.it> (permalink) |
| References | <A49Zg-2WX-3@gated-at.bofh.it> <A4c13-48X-3@gated-at.bofh.it> <A5C37-BT-7@gated-at.bofh.it> |
| X-Mailbox-Line | From debian-python-request@lists.debian.org Tue May 12 12:16:27 2020 |
| Old-Return-Path | <uwe@steinmann.cx> |
| X-Amavis-Spam-Status | No, score=-11.724 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, KHOP_HELO_FCRDNS=0.276, LDO_WHITELIST=-5, PGPSIGNATURE=-5] autolearn=ham autolearn_force=no |
| X-Policyd-Weight | NOT_IN_SBL_XBL_SPAMHAUS=-1.5 CL_IP_EQ_FROM_MX=-3.1; rate: -4.6 |
| MIME-Version | 1.0 |
| Content-Type | multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qL6YN2OI1pnKQLYZ" |
| Content-Disposition | inline |
| X-Mailing-List | <debian-python@lists.debian.org> archive/latest/18274 |
| List-ID | <debian-python.lists.debian.org> |
| List-URL | <https://lists.debian.org/debian-python/> |
| List-Archive | https://lists.debian.org/msgid-search/20200512121542.GZ4188@t560.steinmann.cx |
| Approved | robomod@news.nic.it |
| Lines | 92 |
| Organization | linux.* mail to news gateway |
| Sender | robomod@news.nic.it |
| X-Original-Cc | debian-python@lists.debian.org |
| X-Original-Date | Tue, 12 May 2020 14:15:42 +0200 |
| X-Original-Message-ID | <20200512121542.GZ4188@t560.steinmann.cx> |
| X-Original-References | <20200508105908.GG4188@t560.steinmann.cx> <1982840.YYs7QWACbl@sk-desktop> <d9d2a8ed-64aa-3c36-37c8-5285ad7ccaeb@gmail.com> |
| Xref | csiph.com linux.debian.maint.python:12579 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
On Sat, May 09, 2020 at 11:50:33AM +0200, Gregor Riepl wrote: > >> I'm packaging a c++ program (horizon-eda) which also contains a > >> python module written in c++. Upstream's Makefile has a target 'pymodule' > >> and 'make pymodule' creates horizon.so in the build directory. > >> According to upstream this has to be copied іnto python's sys.path > > > > The preferred mechanism would be to install the .so file into: > > > > usr/lib/python3.X/dist-packages/ (where X is the python3 version you are > > building with) > > "horizon.so" isn't multi-arch safe, so please ensure it gets a suitable > filename on installation. > > All CPython modules I can find on my system use one of these forms: > /usr/lib/python3/dist-packages/package.cpython-38-x86_64-linux-gnu.so > /usr/lib/python3/dist-packages/package/module.cpython-38-x86_64-linux-gnu.so > /usr/lib/python3.8/dist-packages/package/module.cpython-38-x86_64-linux-gnu.so > > I assume this would normally be done by distutils, or is it handled by > dh_python3 automatically? Looks like this is handled by dh_python3. I created a <package-name>.pyinstall file with just a single line horizon.so 3.8- horizon.so is copied to usr/lib/python3/dist-packages/horizon.cpython-38-x86_64-linux-gnu.so But there is still a problem. horizon.so is actually located in a directory named 'build' and I had to move it out of there to be found by dh_python3. If I leave it in 'build' and change the content of the pyinstall file to build/horizon.so 3.8- then horizon.so will end up in usr/lib/python3/dist-packages/build/ So I tried to set the namespace as documented in the man page of dh_python3 Syntax: path/to/file [VERSION_RANGE] [NAMESPACE] Unfortunately the syntax doesn't quite match the examples in the man page: debian/*.py spam.egg 3.2 I suppose 'spam.egg' is the namespace which should be after the version range. Anyway, neither way works. horizon.so ends up in a subdirectory 'build' Do I need the pyinstall file at all? What other package could I look at, which installs a .so file? Uwe -- MMK GmbH, Fleyer Str. 196, 58097 Hagen Uwe.Steinmann@mmk-hagen.de Tel: 02331 840446 Fax: 02331 843920
Back to linux.debian.maint.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Best practice on how to package a python module along with a c++ program Uwe Steinmann <uwe@steinmann.cx> - 2020-05-08 14:10 +0200
Re: Best practice on how to package a python module along with a c++ program Scott Kitterman <debian@kitterman.com> - 2020-05-08 16:20 +0200
Re: Best practice on how to package a python module along with a c++ program Uwe Steinmann <uwe@steinmann.cx> - 2020-05-12 14:20 +0200
csiph-web