Python Artifact
Portable, self-contained distribution of CPython, the reference implementation of the Python programming language, built from the python-build-standalone project (maintained by Astral). This repository is consumed by the Embedbits Platform Artifact Handler to locate, download, verify, and configure a Python interpreter in downstream embedded build tooling (build scripts, code generators, flashing/test utilities, and similar tasks that need Python without depending on whatever is installed on the host machine).
Each branch in this repository plays a distinct role, allowing precise version control and reproducible builds across projects.
Repository contents
python/
├── main branch
│ ├── README.md ← this file
│ └── ArtifactConfig.cmake ← Artifact metadata template
│
├── Core branch
│ ├── ArtifactConfig.cmake ← Artifact metadata (name, version constraints, asset naming)
│ └── CMakePythonDefaults.cmake ← Python integration logic (interpreter path setup, invocation helpers)
│
└── Bin branch ← anchor branch, empty commits only (see "How binaries are published" below)
tags: Bin/<version>-<platform>, e.g. Bin/3.12.8-Unix
Role in the platform
GitHub (Embedbits)
──────────────────────────────────────────────────────────
Artifact-python
main branch → README, ArtifactConfig.cmake template
Core branch → CMake handler scripts
Bin branch → anchor branch + per-version/platform tags
Bin/3.11.9-Unix → GitHub Release: CPython 3.11.9, Linux x86_64
Bin/3.12.8-Win → GitHub Release: CPython 3.12.8, Windows x86_64
Bin/3.13.5-DarwinARM → GitHub Release: CPython 3.13.5, macOS arm64
...
The Platform Artifact Handler in downstream projects references this repository as a Git submodule. At CMake configure time it reads ArtifactConfig.cmake to determine which release to fetch, then downloads and verifies the appropriate binary archive from that tag's GitHub Release assets.
How binaries are published
The Bin branch itself only ever contains empty commits — one per published version — used purely as anchors for tagging. The actual binaries are not committed as tracked files in the branch tree. Instead, each Bin/<version>-<platform> tag points to a GitHub Release, and the real archive plus its SHA-256 hash file are attached to that release as release assets:
Bin/3.12.8-Unix (tag + GitHub Release)
├── python-3.12.8-Unix.zip
└── python-3.12.8-Unix.zip.hash
The Artifact Handler protocol itself is not tied to GitHub Releases specifically — it also supports binaries committed directly as tracked files on
Bin(tagged per version/platform) for Git hosts without an equivalent Releases API. This repository uses the GitHub-Release-asset mode.
⚠️ Clone only the branch you need
This repository may contain release metadata across many versions. Always fetch a specific version's assets via its GitHub Release rather than cloning the full Bin branch history.
gh release download Bin/3.12.8-Unix --repo Embedbits/Artifact-python --pattern '*.zip'
Supported platforms
| Platform code | Target | python-build-standalone triple |
|---|---|---|
Unix | Linux x86_64 (glibc) | x86_64-unknown-linux-gnu |
Win | Windows x86_64 | x86_64-pc-windows-msvc |
DarwinARM | macOS arm64 | aarch64-apple-darwin |
Each build is the install_only variant: a self-contained, portable CPython distribution with the full standard library (including pip), and no extra runtime dependencies beyond what the standard library itself needs.
Included components
| Component | Description |
|---|---|
python/python.exe | Main CPython interpreter executable |
pip | Pre-installed, ready to use out of the box |
| Standard library | Full Lib/ tree, as shipped by python-build-standalone |
Usage
The artifact is installed automatically during the Artifacts setup phase via:
cmake -P Artifacts/Python/ArtifactConfig.cmake
The script ensures the CPython interpreter is available, unpacks the archive if needed, and adds it to the system PATH for subsequent build steps.
CMake helper API
Python_ArtifactInit(${ARTIFACT_BIN_PATH})
Python_GetArtifactVersion(PYTHON_VERSION)
Python_ArtifactInit resolves the interpreter path for the current host platform and exposes it as Python_EXECUTABLE. Python_GetArtifactVersion returns the CPython version string (x.y.z) currently configured for the project.
Versioning
Artifact versions correspond directly to CPython release versions:
3.10.21, 3.11.9, 3.12.8, 3.13.5, ...
New versions are published by Python_Importer.sh in the GithubArtifactsHandler repository, which tracks python-build-standalone releases, downloads the install_only builds for each supported platform, repacks them as .zip archives with SHA-256 verification, and publishes them as GitHub Releases tagged per version and platform.
Because python-build-standalone republishes builds for every currently supported CPython branch on each of its own (date-based) releases, the same CPython version can appear across multiple upstream releases — only the most recent build is imported.
Notes
- No installation required — the build is portable and self-contained; no system Python is required or affected.
- Offline use is supported once the artifact is cached locally.
- In Azure DevOps pipelines, caching the artifact folder is recommended to reduce build time.
License
CPython is distributed under the Python Software Foundation License (PSF License). For details, see: https://docs.python.org/3/license.html
The python-build-standalone project bundles additional third-party components (OpenSSL, SQLite, libffi, ncurses, readline, and others), each under their own respective licenses — see the python-build-standalone documentation for the full list.
Authors
- Mr.Nobody — embedbits.com
Contributions are welcome! Please open a pull request.