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


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

Installation paths

Started byAlec Leamas <leamas.alec@gmail.com>
First post2022-06-03 13:20 +0200
Last post2022-06-03 13:40 +0200
Articles 2 — 2 participants

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


Contents

  Installation paths Alec Leamas <leamas.alec@gmail.com> - 2022-06-03 13:20 +0200
    Re: Installation paths Dmitry Shachnev <mitya57@debian.org> - 2022-06-03 13:40 +0200

#14130 — Installation paths

FromAlec Leamas <leamas.alec@gmail.com>
Date2022-06-03 13:20 +0200
SubjectInstallation paths
Message-ID<Eudvr-2g91-1@gated-at.bofh.it>
Dear list,

This issue was started on debian-devel. However, this list is perhaps a 
better choice (?)

I try handle a package which installs a partly compiled, 
architecture-dependent python module. That is, besides some normal 
python files it also contains a compiled, architecture-dependent so-file 
which is imported by the python files.

Until now  this has been installed in 
/usr/lib/triplet/python3.10/site-packages. This scheme has basically 
worked fine.

However, here is an Ubuntu bug [1] where a user runs into problems 
because this installation path is not in sys.path by default.

I have been trying to look in the python policy docs, but cannot find 
the exact way to install code like this.

Any thoughts out there?

Cheers!
--alec


[1] https://bugs.launchpad.net/ubuntu/+source/lirc/+bug/1843988

[toc] | [next] | [standalone]


#14131

FromDmitry Shachnev <mitya57@debian.org>
Date2022-06-03 13:40 +0200
Message-ID<EudON-2gfh-1@gated-at.bofh.it>
In reply to#14130

[Multipart message — attachments visible in raw view] — view raw

Hi Alec!

On Fri, Jun 03, 2022 at 12:58:44PM +0200, Alec Leamas wrote:
> Dear list,
>
> This issue was started on debian-devel. However, this list is perhaps a
> better choice (?)
>
> I try handle a package which installs a partly compiled,
> architecture-dependent python module. That is, besides some normal python
> files it also contains a compiled, architecture-dependent so-file which is
> imported by the python files.
>
> Until now  this has been installed in
> /usr/lib/triplet/python3.10/site-packages. This scheme has basically worked
> fine.

The correct installation location depends on whether it's a private or public
module.

If it's a private module of your application (not intended to be used by
other apps), then you should use a private path like described in our Python
Policy:

https://www.debian.org/doc/packaging-manuals/python-policy/#programs-shipping-private-modules

Something like /usr/lib/lirc or /usr/lib/<triplet>/lirc should work. But
then you should also modify the application itself to add that location to
sys.path.

If it's a public module that may be used by other applications, then you
should install to /usr/lib/python3/dist-packages (without the <triplet> part).

You can install to /usr/lib/python3.10/dist-packages if you want, then
dh_python3 will move from python3.10 to python3.

--
Dmitry Shachnev

[toc] | [prev] | [standalone]


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


csiph-web