Related Work
The flatpak-pip-generator script is very similar to this project. Both scripts basically serve the same purpose, and this project took a lot of inspiration from flatpak-pip-generator. In fact, this project was created when we discussed feature request #296 in flatpak-pip-generator. A prototype followed from this feature request, and since it was written from scratch, the prototype became this separate project.
Comparison between flatpak-pip-generator and req2flatpak.py:
Each of the two projects has its own benefits.
A comparison will likely change over time.
As of October 2022, in the personal opinion of the author (johannesjh),
the two projects compare as follows:
Both projects generate build modules for flatpak-builder.
Both projects have minimal dependencies.
flatpak-pip-generatorresolves dependencies and freezes dependency versions, whereasreq2flatpak.pyasks the user to provide a fully resolved list of dependencies with frozen dependency versions. Various tools exist which make this easy, e.g., pip, pip-compile and poetry.flatpak-pip-generatoris older and thus likely to be more mature. It supports more commandline options and probably has a more complete feature set.req2flatpak.pyis faster. The script itself runs faster because it does not need to download package files in order to generate the build module. And the flatpak build runs faster because all packages (from the entirerequirements.txtfile) are installed in a single call topip install.req2flatpak.pyre-implements some functionality of pip. In contrast,flatpak-pip-generatoruses pip’s official functionality. Specifically,req2flatpak.pyre-implements how pip queries available downloads from PyPI and how pip chooses suitable downloads to match a given target platform.req2flatpak.pyprefers binary wheels, whereasflatpak-pip-generatorprefers source packages.