• Installation paths

    From Alec Leamas@21:1/5 to All on Fri Jun 3 13:10:01 2022
    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

    PS: I messed up the subscription, this is message is possibly
    duplicated. Sorry in that case. DS

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alec Leamas@21:1/5 to All on Fri Jun 3 13:20:01 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry Shachnev@21:1/5 to Alec Leamas on Fri Jun 3 13:40:01 2022
    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

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEE5688gqe4PSusUZcLZkYmW1hrg8sFAmKZ8toACgkQZkYmW1hr g8vtAA/+ORr2TAXyL0jbTKtW5uW3rH0O0YK0kZ6yNVV5OfUJiMCDkYFk1PrX/Jwh 3VDxUE7STbwNmMxds+w3FhmrbXhfXvKJRX+jb8fSdIbaVoa/DyZyIfrH2nigSmKJ rsnUQJfnbw0O21gn2sX3rmRFzO+ZRTVCUa7JipgN8fMdBv+0EcYjCKyKkjHSgkbL 51mS4fSMZp1M8TVKruLHDxYGuT1W+KU0QNNdyupjTLkcGM6C/Yoa1rTGobl8MwMi OE+Zh3/zK4BdI0lhoAvATHXpI6BUJM5tH3Vy6riiTt5oFhQssU7yEFyBhLEs0R3q QK0kKmmPl0boG0J/5vu2VMkFgEkbzMDzSDXFB84QDg07tIlfJQ5eeq9Z2TT3aHiz qKD/lKm/CworJ8KdmTacVHIA3e4lkTZ/KbY6bVs/WErpTLgqEN88EzRasQPZHjVr Atis4maaWySsb/F4jMHlo1wZ1ARzAXZUi4E8HRWKXHqCADnR4s+PQ+kGnlEUoVNW vL8kYxuBMrW5aJIHPoTAOMBgcDHHw1hlWZDnfLPnGuMYugBYzRNoeTQ7Tv7LEM4s hbLAnA6FRrzmCWbB1GEgQSgMfoeD+8pqpqIMAB/3l3pgxMqlS7qTECghXZ7BkR1L e4C0NVs0F4DBLNVmpTYImq3EvoV1J+nvOiLSmGz1PC4DUw2NnO8=
    =fkSW
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)