bundleup 0.1.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bundleup-0.1.0 → bundleup-0.2.1}/PKG-INFO +14 -8
- {bundleup-0.1.0 → bundleup-0.2.1}/README.md +13 -7
- {bundleup-0.1.0 → bundleup-0.2.1}/pyproject.toml +1 -1
- {bundleup-0.1.0 → bundleup-0.2.1}/pyproject.toml.orig +1 -1
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/__init__.py +1 -1
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_build.py +361 -158
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_bytecode.py +80 -22
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_cache.py +105 -25
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_check.py +265 -50
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_cli.py +321 -84
- bundleup-0.2.1/src/bundleup/_config.py +336 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_coverage.py +96 -22
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_exe.py +176 -59
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_formats.py +3 -3
- bundleup-0.2.1/src/bundleup/_imports.py +493 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_loader.py +470 -95
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_outputs.py +162 -103
- bundleup-0.2.1/src/bundleup/_payload.py +935 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_platforms.py +121 -21
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_python.py +181 -29
- bundleup-0.2.1/src/bundleup/_runtime.py +348 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_sitecustomize.py +22 -6
- bundleup-0.2.1/src/bundleup/_smoke.py +291 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_source.py +209 -43
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_steps.py +0 -1
- bundleup-0.2.1/src/bundleup/_uv.py +1188 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_verify.py +441 -70
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_zipwriter.py +5 -1
- bundleup-0.1.0/src/bundleup/_audit.py +0 -177
- bundleup-0.1.0/src/bundleup/_config.py +0 -128
- bundleup-0.1.0/src/bundleup/_imports.py +0 -145
- bundleup-0.1.0/src/bundleup/_payload.py +0 -401
- bundleup-0.1.0/src/bundleup/_runtime.py +0 -140
- bundleup-0.1.0/src/bundleup/_smoke.py +0 -153
- bundleup-0.1.0/src/bundleup/_target_files.py +0 -147
- bundleup-0.1.0/src/bundleup/_uv.py +0 -468
- {bundleup-0.1.0 → bundleup-0.2.1}/LICENSE +0 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/__main__.py +0 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_errors.py +0 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_term.py +0 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_text.py +0 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/_toml.py +0 -0
- {bundleup-0.1.0 → bundleup-0.2.1}/src/bundleup/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bundleup
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Bundle up your Python app with everything it needs: one .pyz that runs on plain Python, no install step.
|
|
5
5
|
Keywords: bundler,pyz,zipapp,packaging,distribution,cli
|
|
6
6
|
Author: funkyfunc
|
|
@@ -24,13 +24,18 @@ Description-Content-Type: text/markdown
|
|
|
24
24
|
|
|
25
25
|
# bundleup
|
|
26
26
|
|
|
27
|
+
[](https://pypi.org/project/bundleup/)
|
|
28
|
+
[](https://pypi.org/project/bundleup/)
|
|
29
|
+
[](https://github.com/funkyfunc/bundleup/actions/workflows/ci.yml)
|
|
30
|
+
[](https://github.com/funkyfunc/bundleup/blob/main/LICENSE)
|
|
31
|
+
|
|
27
32
|
**Bundle up your Python app with everything it needs.** One command turns a locked project into a
|
|
28
33
|
single `.pyz` that runs on plain Python: no install step, no network, native extensions included.
|
|
29
34
|
And it tells you *before* you ship what won't survive the trip.
|
|
30
35
|
|
|
31
36
|
Dead simple to use, but also powerful and fast: esbuild's experience, for Python.
|
|
32
37
|
|
|
33
|
-
> **Status: alpha (0.
|
|
38
|
+
> **Status: alpha (0.2.0).** Builds for this machine or another platform (Linux, macOS, Windows;
|
|
34
39
|
> x86_64 and arm64), passes the [gauntlet](https://github.com/funkyfunc/bundleup/blob/main/gauntlet/README.md)
|
|
35
40
|
> on all four in CI, and the own test suites of click, packaging, markupsafe and itsdangerous give
|
|
36
41
|
> the same results from a bundle as from a venv (nightly). Try it without installing via
|
|
@@ -43,15 +48,16 @@ bundleup build # the project in this directory -> dist/<name>.p
|
|
|
43
48
|
bundleup build path/to/script.py # a PEP 723 script with inline dependencies
|
|
44
49
|
bundleup build --python 3.9 # build with Python 3.9 (pure Python: runs on 3.9 and newer)
|
|
45
50
|
bundleup build --python 3.11 --python-platform linux # build on a Mac for Linux x86_64
|
|
46
|
-
bundleup build --python-platform linux
|
|
51
|
+
bundleup build --python-platform linux,macos,windows # one file for all three
|
|
52
|
+
bundleup build --external torch # leave a heavy host package out of the bundle
|
|
47
53
|
bundleup build --json # the result as JSON on stdout, for scripts and agents
|
|
48
54
|
bundleup check # what won't survive bundling, and each package's size
|
|
49
|
-
bundleup check --
|
|
55
|
+
bundleup check --python-platform linux,windows # also check Windows wheels
|
|
50
56
|
bundleup check --matrix # which OS, CPU and Python versions the lock's wheels cover
|
|
51
57
|
bundleup build --smoke # then run it once: fresh home folder, no network
|
|
52
|
-
bundleup check --audit # ask PyPI: vulnerable, yanked or brand-new dependencies?
|
|
53
58
|
bundleup build --max-size 30MB # fail, writing nothing, if the bundle is bigger
|
|
54
59
|
bundleup build --format dir # a plain directory, for apps that load packages from one
|
|
60
|
+
bundleup build --format zip # a flat .zip of code, packages and bytecode (e.g. serverless)
|
|
55
61
|
bundleup build --format py # one plain-text .py file (for small tools: gists, uploads)
|
|
56
62
|
bundleup build --split 100MB # no file over 100 MB: a small .pyz and a folder of parts
|
|
57
63
|
bundleup build --format exe # experimental: an executable with its own Python, unsigned
|
|
@@ -62,7 +68,7 @@ python dist/<name>.pyz # run it: no install, no network
|
|
|
62
68
|
|
|
63
69
|
bundleup reads what you have: `pyproject.toml` with `uv.lock` or `pylock.toml`, a script's
|
|
64
70
|
`# /// script` block, or, without a lock, a `pyproject.toml`, `setup.py` or `requirements.txt`
|
|
65
|
-
(resolved at build time, with a warning; [recipes](docs/recipes.md)). It brings its own
|
|
71
|
+
(resolved at build time, with a warning; [recipes](https://github.com/funkyfunc/bundleup/blob/main/docs/recipes.md)). It brings its own
|
|
66
72
|
[uv](https://docs.astral.sh/uv/) for the build; the bundle needs only Python. On first run it
|
|
67
73
|
unpacks to a cache (`~/Library/Caches/bundleup`, `~/.cache/bundleup`, or a temp directory if
|
|
68
74
|
those aren't writable), so later runs start as fast as an installed virtualenv; unpacking a new version removes older
|
|
@@ -70,7 +76,7 @@ copies of the same bundle that went unused for 30 days. A pure-Python
|
|
|
70
76
|
bundle runs on every Python version its lock allows (`Python 3.10+`), and on any OS when the lock
|
|
71
77
|
picks the same packages everywhere (`on any OS`); one with compiled code runs on the version and
|
|
72
78
|
platform it was built for. A bundle only sees
|
|
73
|
-
its own packages and the standard library; set `BUNDLEUP_INHERIT_PATH=1` to also let it use
|
|
79
|
+
its own packages and the standard library; pass `--external <pkg>` (or set `BUNDLEUP_INHERIT_PATH=1` at runtime) to also let it use
|
|
74
80
|
packages installed on the machine (they come after the bundle's, but a machine package can still
|
|
75
81
|
win over a bundled namespace package of the same name: a Python rule, PEP 420). If it's started
|
|
76
82
|
with the wrong Python, it runs itself again with a matching one if one is installed; otherwise, and on
|
|
@@ -85,7 +91,7 @@ runs the same checks without writing a bundle and shows how big each package is;
|
|
|
85
91
|
warnings fail too.
|
|
86
92
|
|
|
87
93
|
Recipes for Claude Skills, AWS Lambda, host applications, CI and HPC:
|
|
88
|
-
[docs/recipes.md](docs/recipes.md).
|
|
94
|
+
[docs/recipes.md](https://github.com/funkyfunc/bundleup/blob/main/docs/recipes.md).
|
|
89
95
|
|
|
90
96
|
## Why
|
|
91
97
|
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
# bundleup
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/bundleup/)
|
|
4
|
+
[](https://pypi.org/project/bundleup/)
|
|
5
|
+
[](https://github.com/funkyfunc/bundleup/actions/workflows/ci.yml)
|
|
6
|
+
[](https://github.com/funkyfunc/bundleup/blob/main/LICENSE)
|
|
7
|
+
|
|
3
8
|
**Bundle up your Python app with everything it needs.** One command turns a locked project into a
|
|
4
9
|
single `.pyz` that runs on plain Python: no install step, no network, native extensions included.
|
|
5
10
|
And it tells you *before* you ship what won't survive the trip.
|
|
6
11
|
|
|
7
12
|
Dead simple to use, but also powerful and fast: esbuild's experience, for Python.
|
|
8
13
|
|
|
9
|
-
> **Status: alpha (0.
|
|
14
|
+
> **Status: alpha (0.2.0).** Builds for this machine or another platform (Linux, macOS, Windows;
|
|
10
15
|
> x86_64 and arm64), passes the [gauntlet](https://github.com/funkyfunc/bundleup/blob/main/gauntlet/README.md)
|
|
11
16
|
> on all four in CI, and the own test suites of click, packaging, markupsafe and itsdangerous give
|
|
12
17
|
> the same results from a bundle as from a venv (nightly). Try it without installing via
|
|
@@ -19,15 +24,16 @@ bundleup build # the project in this directory -> dist/<name>.p
|
|
|
19
24
|
bundleup build path/to/script.py # a PEP 723 script with inline dependencies
|
|
20
25
|
bundleup build --python 3.9 # build with Python 3.9 (pure Python: runs on 3.9 and newer)
|
|
21
26
|
bundleup build --python 3.11 --python-platform linux # build on a Mac for Linux x86_64
|
|
22
|
-
bundleup build --python-platform linux
|
|
27
|
+
bundleup build --python-platform linux,macos,windows # one file for all three
|
|
28
|
+
bundleup build --external torch # leave a heavy host package out of the bundle
|
|
23
29
|
bundleup build --json # the result as JSON on stdout, for scripts and agents
|
|
24
30
|
bundleup check # what won't survive bundling, and each package's size
|
|
25
|
-
bundleup check --
|
|
31
|
+
bundleup check --python-platform linux,windows # also check Windows wheels
|
|
26
32
|
bundleup check --matrix # which OS, CPU and Python versions the lock's wheels cover
|
|
27
33
|
bundleup build --smoke # then run it once: fresh home folder, no network
|
|
28
|
-
bundleup check --audit # ask PyPI: vulnerable, yanked or brand-new dependencies?
|
|
29
34
|
bundleup build --max-size 30MB # fail, writing nothing, if the bundle is bigger
|
|
30
35
|
bundleup build --format dir # a plain directory, for apps that load packages from one
|
|
36
|
+
bundleup build --format zip # a flat .zip of code, packages and bytecode (e.g. serverless)
|
|
31
37
|
bundleup build --format py # one plain-text .py file (for small tools: gists, uploads)
|
|
32
38
|
bundleup build --split 100MB # no file over 100 MB: a small .pyz and a folder of parts
|
|
33
39
|
bundleup build --format exe # experimental: an executable with its own Python, unsigned
|
|
@@ -38,7 +44,7 @@ python dist/<name>.pyz # run it: no install, no network
|
|
|
38
44
|
|
|
39
45
|
bundleup reads what you have: `pyproject.toml` with `uv.lock` or `pylock.toml`, a script's
|
|
40
46
|
`# /// script` block, or, without a lock, a `pyproject.toml`, `setup.py` or `requirements.txt`
|
|
41
|
-
(resolved at build time, with a warning; [recipes](docs/recipes.md)). It brings its own
|
|
47
|
+
(resolved at build time, with a warning; [recipes](https://github.com/funkyfunc/bundleup/blob/main/docs/recipes.md)). It brings its own
|
|
42
48
|
[uv](https://docs.astral.sh/uv/) for the build; the bundle needs only Python. On first run it
|
|
43
49
|
unpacks to a cache (`~/Library/Caches/bundleup`, `~/.cache/bundleup`, or a temp directory if
|
|
44
50
|
those aren't writable), so later runs start as fast as an installed virtualenv; unpacking a new version removes older
|
|
@@ -46,7 +52,7 @@ copies of the same bundle that went unused for 30 days. A pure-Python
|
|
|
46
52
|
bundle runs on every Python version its lock allows (`Python 3.10+`), and on any OS when the lock
|
|
47
53
|
picks the same packages everywhere (`on any OS`); one with compiled code runs on the version and
|
|
48
54
|
platform it was built for. A bundle only sees
|
|
49
|
-
its own packages and the standard library; set `BUNDLEUP_INHERIT_PATH=1` to also let it use
|
|
55
|
+
its own packages and the standard library; pass `--external <pkg>` (or set `BUNDLEUP_INHERIT_PATH=1` at runtime) to also let it use
|
|
50
56
|
packages installed on the machine (they come after the bundle's, but a machine package can still
|
|
51
57
|
win over a bundled namespace package of the same name: a Python rule, PEP 420). If it's started
|
|
52
58
|
with the wrong Python, it runs itself again with a matching one if one is installed; otherwise, and on
|
|
@@ -61,7 +67,7 @@ runs the same checks without writing a bundle and shows how big each package is;
|
|
|
61
67
|
warnings fail too.
|
|
62
68
|
|
|
63
69
|
Recipes for Claude Skills, AWS Lambda, host applications, CI and HPC:
|
|
64
|
-
[docs/recipes.md](docs/recipes.md).
|
|
70
|
+
[docs/recipes.md](https://github.com/funkyfunc/bundleup/blob/main/docs/recipes.md).
|
|
65
71
|
|
|
66
72
|
## Why
|
|
67
73
|
|