Hi c.buhtz (2026.02.14_11:59:50_+0000)
Imagine a modern Python application following PEP 517 & 621
(pyproject.toml and src-layout). Translations are handled via GNU
gettext. Hatch(ling) is used as build system using "initialize" build
hook to compile po into mo files and add them into the wheel.
The application does access them via "importlib.resources".

How does this interfere with Debian packaging?
I don't want to create extra work for people like you.

If it's package data inside the package, it should all end up in the right place for importlib.resources to find.

Python build tools don't provide a mechanism to install things like manpages into the right place (because python packaging isn't aimed at a complete system, but a Python environment). So the packager has to move things around, themselves.

In a Debian package the mo files do not belong into the wheel but into
/usr/share/locale.

I don't know the correct pattern for this offhand, but I'd imagine that you can try both a path located via improtlib.resources, and the default localedir, when configuring your translations.

Is the Python build system relevant while Debian packing? Is pip used
internally while you create the deb file? Or do you use your own way
and the build system used by upstream does not matter?

Pip is not used. We use "build", another PEP 517 implementation, to build a wheel, that we then install the contents of.

Stefano

--
Stefano Rivera
  http://tumbleweed.org.za/
  +1 415 683 3272

Reply via email to