Skip to main content

Module python_bundle

Module python_bundle 

Source
Expand description

Bundling a pinned CPython 3.12 so an exported game runs on a machine with no Python installed.

Shape follows the “embedded” distribution: the shared library plus a stdlib zip and nothing else. pite is a native module registered from Rust, so no site-packages ship. The archive is cached under the toolchain dir (PITE_TOOLCHAIN_DIR, default ~/.cache/pite/toolchains) and never vendored in the repo; a checksum mismatch or an offline machine is a loud error, and --no-bundle-python keeps the older system-Python gate.

Structs§

BundleSpec
One platform’s pinned artifact.
StagedBundle
What an exported directory needs to find the bundled interpreter.

Constants§

ARCHIVE_ROOT
Every member path in these archives sits under this directory.
PINNED_BUILD
Pinned upstream build: astral-sh/python-build-standalone, install_only. Checksums come from the release’s SHA256SUMS.
PINNED_PYTHON

Functions§

archive_path
ensure_archive
Fetch the pinned archive into the toolchain cache and verify it. A cached file is re-verified every time: a bad cache is never trusted.
launcher_env
Env the launcher must set for a staged bundle. Proved on Linux and macOS: the process runs with no Python on PATH.
pinned
The pinned artifact for platform, or None when we do not ship one.
pinned_platforms
Every platform whose bundle artifact is pinned and checksummed.
stage
Extract the shared library, pack the stdlib into a zip, and lay both out under dest (<out>/python). site-packages is deliberately dropped.
toolchain_dir
Where downloaded toolchains live. Never inside the project or repo.
verify
Checksum gate. Never warns, never repairs: a mismatch is fatal.