pyproject.toml, new build tool, improve github workflows
closes https://github.com/sezanzeb/input-remapper/issues/1170
pip, in many cases, fails to install data files, which need to go into system paths, and instead puts them (despite them being absolute paths, and common workarounds/fixes) into /usr/lib/python3/inputremapper/usr/share/...
python3 setup.py install is deprecated. So I had to remove the existing installation shell script.
meson fails to install the module into a path that can actually be imported, and its python features require one to specify each individual file of the module.
So instead input-remapper will use a custom python solution. Hopefulls this works well enough to prevent all ModuleNotFoundErrors in the future.
Surprisingly, this is not much more code that would otherwise be required. We already had the data_files list and would need it with meson as well with more boilerplate. The python code to generate translations was already there. We (even with meson) need to figure out the correct python-package target path (see code comments). And on the upside, we have a lot of flexibility and control without having to dig into configuration, unexpected behavior and deal with any further limitations.
This PR also changes github workflows
- runs tests not as root anymore, which previously probably made them run with ubuntu-lts python3.12 every time, instead of the min and max versions
- adds ruff
- tests if the .deb build and the install module install correctly and result in a working system
# Important changes for packaging:
- setup.py is replaced with pyproject.toml now. So `setup.py install` cannot be used anymore
- building can be done via `python3 -m install --root ./foo`, which puts all files in the expected target directory structure in root. In my case, on ubuntu 25.04, the module ends up in `foo/usr/lib/python3/dist-packages`. It picks the best option from `python3 -c "import sys; print(sys.path)"` for this. If this is missing a feature to make it helpful for packaging, please let me know
- `commit_hash.py` is not built anymore, instead, values are inserted into `installation_info.py`
合并状态:未合并 9 条评论