{"id":28569609,"url":"https://github.com/johannesjh/req2flatpak","last_synced_at":"2025-06-10T17:15:39.220Z","repository":{"id":61846439,"uuid":"552099747","full_name":"johannesjh/req2flatpak","owner":"johannesjh","description":"Convert Python package requirements to Flatpak build manifests","archived":false,"fork":false,"pushed_at":"2025-03-30T13:44:03.000Z","size":4754,"stargazers_count":23,"open_issues_count":5,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-02T12:06:02.813Z","etag":null,"topics":["builder","dependencies","flatpak","generate","manifest","packaging","python","requirements"],"latest_commit_sha":null,"homepage":"https://johannesjh.github.io/req2flatpak/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johannesjh.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-15T20:15:01.000Z","updated_at":"2025-05-19T21:00:02.000Z","dependencies_parsed_at":"2024-09-16T20:39:31.971Z","dependency_job_id":null,"html_url":"https://github.com/johannesjh/req2flatpak","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannesjh%2Freq2flatpak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannesjh%2Freq2flatpak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannesjh%2Freq2flatpak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannesjh%2Freq2flatpak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johannesjh","download_url":"https://codeload.github.com/johannesjh/req2flatpak/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannesjh%2Freq2flatpak/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259114714,"owners_count":22807255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["builder","dependencies","flatpak","generate","manifest","packaging","python","requirements"],"created_at":"2025-06-10T17:15:14.880Z","updated_at":"2025-06-10T17:15:39.203Z","avatar_url":"https://github.com/johannesjh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"req2flatpak\n===========\n\n.. inclusion-marker-do-not-remove\n\n``req2flatpak`` is a script to convert python package requirements\nto a flatpak-builder build module.\nThe module will install the required python packages\nas part of a flatpak build.\n\n\nIntended Use\n------------\n\nreq2flatpak is for programmers\nwho want to package a python application using flatpak.\n\nThe req2flatpak script takes python package requirements as input, e.g., as\n``requirements.txt`` file. It allows to specify the target platform’s\npython version and architecture. The script outputs an automatically\ngenerated ``flatpak-builder`` build module. The build module, if included\ninto a flatpak-builder build manifest, will install the python packages\nusing pip.\n\nGetting Started\n---------------\n\nInstall req2flatpak using pip (or any other python package installer),\ne.g., by running ``pip install req2flatpak``.\n\nPrepare a ``requirements.txt`` file with the packages that you want to install as part of a flatpak build.\nYou need to specify exact versions for all the packages including their dependencies.\n(Various tools exist to help creating such a requirements file with fully resolved dependencies and frozen package versions;\nfor example, you can use\n`pip-compile \u003chttps://pypi.org/project/pip-tools/\u003e`_ or \n`poetry export \u003chttps://pypi.org/project/poetry-plugin-export/\u003e`_ to export a suitable ``requirements.txt`` file).\n\nRun req2flatpak. \nFor example, run this command to generate a ``flatpak-builder`` build module\nfrom your ``requirements.txt`` file:\n\n.. code:: bash\n\n   ./req2flatpak.py --requirements-file requirements.txt --target-platforms 310-x86_64 310-aarch64\n\nWhen invoked like this, req2flatpak will\nread the requirements file,\nquery pypi about available downloads for the requirements,\nchoose appropriate downloads for the specified target platforms,\nand generate a flatpak-builder build module.\nThe module, if included in a flatpak-builder build manifest,\nwill install the required packages using pip.\nThe commandline option to define target platforms uses the format ``\u003cpythonversion\u003e-\u003carchitecture\u003e``.\nTo learn more about available commandline options,\nrun ``req2flatpak.py --help``.\n\nNote that programmatic usage of req2flatpak is also possible.\nThis means you can write a python script to invoke req2flatpak,\nwhich allows to tweak the desired behavior in many ways.\n\nGo read the `documentation \u003chttps://johannesjh.github.io/req2flatpak/\u003e`__\nto learn more about req2flatpak's commandline and Python APIs.\nThe documentation includes further examples to help you get started quickly.\n\n\nDocumentation\n-------------\n\nSee https://johannesjh.github.io/req2flatpak/\n\n\nContributing\n------------\n\nreq2flatpak is developed in an open-source, community-driven way, as a\nvoluntary effort in the authors’ free time.\n\nAll contributions are greatly appreciated… pull requests are welcome,\nand so are bug reports and suggestions for improvement.\nSee req2flatpak’s documentation for how to set up a development environment\nand how to contribute back to req2flatpak.\n\nRelated Work\n------------\n\nThe\n`flatpak-pip-generator \u003chttps://github.com/flatpak/flatpak-builder-tools/blob/master/pip/flatpak-pip-generator\u003e`__\nscript is very similar to this project. Both scripts basically serve the same purpose,\nand this project took a lot of inspiration from\nflatpak-pip-generator. In fact, this project was created when we\ndiscussed feature request\n`#296 \u003chttps://github.com/flatpak/flatpak-builder-tools/issues/296\u003e`__\nin flatpak-pip-generator. A prototype followed from this feature\nrequest, and since it was written from scratch, the prototype became\nthis separate project.\n\nComparison between ``flatpak-pip-generator`` and ``req2flatpak.py``:\nEach of the two projects has its own benefits.\nA comparison will likely change over time.\nAs in Oct, 2022, in my personal opinion (johannesjh),\nI see the following similarities and differences:\n\n*  Both projects generate build modules for flatpak-builder.\n\n*  Both projects consist of a single script file with minimal\n   dependencies, and are thus very easy to install.\n\n*  ``flatpak-pip-generator`` resolves dependencies and freezes\n   dependency versions, whereas ``req2flatpak.py`` asks the user to\n   provide a fully resolved list of dependencies with frozen dependency\n   versions. Various tools exist which make this easy, e.g.,\n   pip, pip-compile and poetry.\n\n*  ``flatpak-pip-generator`` is older and thus likely to be more mature.\n   It supports more commandline options and probably has a more complete\n   feature set.\n\n*  ``req2flatpak.py`` is faster. The script itself runs faster because\n   it does not need to download package files in order to generate the\n   build module. And the flatpak build runs faster because all packages\n   (from the entire ``requirements.txt`` file) are installed in a single\n   call to ``pip install``.\n\n*  ``req2flatpak.py`` re-implements some functionality of pip. In\n   contrast, ``flatpak-pip-generator`` uses pip’s official\n   functionality. Specifically, ``req2flatpak.py`` re-implements how pip\n   queries available downloads from pypi and how pip chooses suitable\n   downloads to match a given target platform.\n\n*  ``req2flatpak.py`` prefers binary wheels, whereas\n   ``flatpak-pip-generator`` prefers source packages.\n\nLicense\n-------\n\nreq2flatpak is MIT-licensed, see the ``COPYING`` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohannesjh%2Freq2flatpak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohannesjh%2Freq2flatpak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohannesjh%2Freq2flatpak/lists"}