this is an unofficial pypi distribution of the flatpak_pip_generator script
Project description
Flatpak PIP Generator
This is an unofficial pypi distribution of the flatpak_pip_generator script
upstream - https://github.com/flatpak/flatpak-builder-tools/tree/master/pip
Tool to automatically generate flatpak-builder manifest json from a pip
package-name.
This requires requirements-parser which can be installed on your host with pip3 install --user requirements-parser.
Usage
flatpak-pip-generator --runtime='org.freedesktop.Sdk//22.08' foo which generates python3-foo.json and can be included in a manifest like:
"modules": [
"python3-foo.json",
{
"name": "other-modules"
}
]
You can also list multiple packages in single command:
flatpak-pip-generator --runtime='org.freedesktop.Sdk//22.08' foo\>=1.0.0,\<2.0.0 bar
If your project contains a requirements.txt file with all the project dependencies, you can use
flatpak-pip-generator --runtime='org.freedesktop.Sdk//22.08' --requirements-file='/the/path/to/requirements.txt' --output pypi-dependencies
You can use that in your manifest like
"modules": [
"pypi-dependencies.json",
{
"name": "other-modules"
}
]
Source Selection
By default, this tool selects artifacts from PyPI using the following
priority: universal wheels (none-any.whl) > sdists.
If neither is available for a module, the an error is raised.
Platform-specific wheels are ignored unless explicitly enabled via
--prefer-wheels=module1,module2,....
When --prefer-wheels is used, a Flatpak runtime must be provided with
the --runtime argument. The runtime must include Python, pip, and
python-packaging module. This is used to determine platform tags
(Python version, ABI, and architecture).
By default, platform wheels are considered for the following
x86_64 and aarch64. This can be overridden with
--wheel-arches arch1 arch2 ....
If the specified runtime is only available for a single architecture, platform tags for other architectures are inferred from it.
Examples for preferring platform wheels
Generate for x86_64 and aarch64
./flatpak-pip-generator --runtime org.freedesktop.Sdk//25.08 --prefer-wheels=cryptography,cffi cryptography
Generate for only x86_64
./flatpak-pip-generator --runtime org.freedesktop.Sdk//25.08 --prefer-wheels=cryptography,cffi --wheel-arches x86_64 cryptography
Generate for x86_64 and ppc64le
./flatpak-pip-generator --runtime org.freedesktop.Sdk//25.08 --prefer-wheels=cryptography,cffi --wheel-arches x86_64,ppc64le cryptography
Options
usage: flatpak-pip-generator [-h] [--python2] [--cleanup {scripts,all}] [--requirements-file REQUIREMENTS_FILE] [--pyproject-file PYPROJECT_FILE] [--optdep-groups [GROUP ...]] [--build-only]
[--build-isolation] [--ignore-installed IGNORE_INSTALLED] [--checker-data] [--output OUTPUT] [--runtime RUNTIME] [--yaml] [--ignore-errors] [--ignore-pkg [IGNORE_PKG ...]]
[--prefer-wheels PREFER_WHEELS] [--wheel-arches WHEEL_ARCHES]
[packages ...]
positional arguments:
packages
options:
-h, --help show this help message and exit
--python2 Look for a Python 2 package
--cleanup {scripts,all}
Select what to clean up after build
--requirements-file, -r REQUIREMENTS_FILE
Specify requirements.txt file. Cannot be used with pyproject file.
--pyproject-file PYPROJECT_FILE
Specify pyproject.toml file. Cannot be used with requirements file.
--optdep-groups [GROUP ...]
Specify optional dependency groups to include. Can only be used with pyproject file.
--build-only Clean up all files after build
--build-isolation Do not disable build isolation. Mostly useful on pip that does't support the feature.
--ignore-installed IGNORE_INSTALLED
Comma-separated list of package names for which pip should ignore already installed packages. Useful when the package is installed in the SDK but not in the runtime.
--checker-data Include x-checker-data in output for the "Flatpak External Data Checker"
--output, -o OUTPUT Specify output file name
--runtime RUNTIME Specify a flatpak to run pip inside of a sandbox, ensures python version compatibility. Format: $RUNTIME_ID//$RUNTIME_BRANCH
--yaml Use YAML as output format instead of JSON
--ignore-errors Ignore errors when downloading packages
--ignore-pkg [IGNORE_PKG ...]
Ignore packages when generating the manifest. Needs to be specified with version constraints if present (e.g. --ignore-pkg 'foo>=3.0.0' 'baz>=21.0').
--prefer-wheels PREFER_WHEELS
Comma-separated list of packages for which platform wheels should be preferred over sdists
--wheel-arches WHEEL_ARCHES
Comma-separated list of architectures for which platform wheels should be generated (default: x86_64,aarch64)
Development
- Install uv https://docs.astral.sh/uv/getting-started/installation/
uv sync -v --all-groups --frozen- Format and lint:
uv run ruff format && uv run ruff check --fix --exit-non-zero-on-fix - Type check:
uv run mypy .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flatpak_pip_generator-26.4.12.tar.gz.
File metadata
- Download URL: flatpak_pip_generator-26.4.12.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"PikaOS","version":"4","id":"nest","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56620edbaed708dcff0486a144abaddc36f688648824ed389c8db49086e91703
|
|
| MD5 |
9fff87abab3f39fd98b0bf59186a055c
|
|
| BLAKE2b-256 |
9e75b7aebd66cbe567ec16605241cec3cf2c3186865530870f533a1a329d504d
|
File details
Details for the file flatpak_pip_generator-26.4.12-py3-none-any.whl.
File metadata
- Download URL: flatpak_pip_generator-26.4.12-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"PikaOS","version":"4","id":"nest","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
056a433517b9a7ed3ac45f0db2c56c5a4fe273ca7347c201b58a4dcf9bc9ce8e
|
|
| MD5 |
308e0bf1df3eb46bdbbb8395f125b8a1
|
|
| BLAKE2b-256 |
a0514b92aa9dc82fa1eee7bcd9e44fa192a580565393d3c788d21ab5db536668
|