Python Bundler (experimental)
This repo creates executable zipfiles similar to zipapp, pex, and shiv.
It's useful when one:
- Wants to create compiled packages from a lockfile
- Wants to be able to debug the resulting environment without unzipping
- Doesn't mind an initial startup cost to create the virtualenv
- Wants to use mostly python tooling instead of rejiggering everything to e.g. Bazel
It does not solve some of the core problems with python and its packaging, such as:
- Some python packages will not work on different python versions, architectures, etc
- Python takes up a lot of space relative to its functionality
- Python is duck-typed at runtime
Alternatives:
| Package Name | Is publicly supported | Requires different directory structure | Installs all dependencies automatically | Easy to debug |
|---|---|---|---|---|
| zipapp | yes, included with python | Maybe, must have __main__.py |
No, they must be manually included via pip install -r requirements.txt --target <directory> before build time |
No, must unzip the file to edit |
| pex | yes, large project | No, works on console scripts | Can specify requirements.txt manually at build time | No, must unzip the file to edit |
| shiv | yes, past 1.0.0, by linkedin | No, works on console scripts | No, must specify the dependencies on the command line at build time | No, must unzip the file to edit |
| this repo | no | No, works on console scripts | Yes, uses poetry lockfile | Yes, can edit the installation venv |
| bazel | yes, but many modern-python conveniences have a time lag | Yes | One can wire it up with requirements.txt | No, but it can made to be with some effort |
Rough Comparisons:
| Package Name | Runtime | Command | English definition | Size |
|---|---|---|---|---|
| zipapp | 1.9-2.5s | pip install . --target python_bundler && python -m zipapp python_bundler/ |
Install the current package to the target directory, then make a zipapp out of said directory | 48M |
| pex | 5s for the first run, then 3.2-3.5s | pex '.' --console-script python_bundler --output project_bundle.pex |
Make a pex env containing the current package, then make an executable pexfile out of the python_bundler console script | 21M |
| shiv | 2.5s for the first run, then 0.6-0.8s | shiv -c python_bundler -o python_bundler.shiv '.' |
Make a shiv file using python_bundler console script. Install the current directory. | 20M |
| this repo | 11s for the first run, then 0.6-0.7s | python_bundler python_bundler |
Use the current directory's lockfile to create an executable zipfile from the python_bundler console script | 16M |
| bazel | n/a | n/a | n/a | n/a |
Metadata
Release files for python-bundler 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_bundler-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for python_bundler-0.3.0-py3-none-any.whl |
Release files / python_bundler-0.3.0-py3-none-any.whl
| Download URL | python_bundler-0.3.0-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af18dfd038658711b2ef6e870f23200315e042d11273f84906e13b7e0e0dc52f
|
|
BLAKE2b-256 checksum How to use checksums |
a52151adf54a33c5a653b97da7b73e91d0563a27ba364b7cf13d1e3502336847
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Security for python-bundler 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.