I’m in the process of migrating the fenrir screenreader to use the newer pyproject.toml style of package configuration and have hit a bit of a snag.
In the base directory, we have folders the likes of conf, tools, docs, and so on. I was trying to figure out how to tell the build backend to put the things in conf into /etc when the user goes to install the package from their package manager, tools in /usr/share/fenrirscreenreader/tools, locale in /usr/share/locale and so on. So far, I’ve come up a bit empty; I’ve spent a few hours searching and so far the conclusion seems to be to have the packaging script install those by itself. Is this accurate or have I missed something? If not, where is the specification for mapping source paths to destinations? The package data in setuptools didn’t quite look like what I am after, or I didn’t see an example that fit the bill for what I’m trying to do. Thanks in advance for the guidance.
What package manager? Do you mean something like pip?
With tools like pip, and the PyPA ecosystem in general this is not possible. It used to be possible to do this (and maybe it kind of still is possible if you try hard enough), but it was a bad thing – for some relatively subjective definition of “bad” – and modern packaging tools do not allow it as far as I can remember.
One reason is that such a mechanism is not cross-platform (what is /etc on Windows?). Modern Python packaging ecosystem (at least PyPA) does not want to allow this behavior any longer and this behavior was never standardized into a specification.
What you want to achieve is very much dependent on the operating system, and as such should be handled by the packaging ecosystem of the operating system. For example on Debian, Ubuntu, and all their derivatives it should be handled by the apt package manager via .deb files (instead of pip and sdists or wheels files).
More concretely, what you were using was probably data_files in setup.py. As far as I can tell this data_files feature is deprecated in setuptools. I do not think any of the other modern Python packaging tools has any explicit support for this. It might still work somehow, though, but I doubt it.