This repository currently ships a macOS-only embedded CPython runtime. The goal of the next iteration is to move to a broader Apple artifact that can cover:
- macOS
- iOS and iPadOS
- Mac Catalyst
- CPython officially documents building an iOS
Python.xcframework. - BeeWare's
Python-Apple-supportpublishes prebuilt support packages for macOS and iOS, and those packages already contain mergeablePython.xcframeworkbundles.
Relevant upstream references:
https://docs.python.org/3.14/using/ios.htmlhttps://github.com/beeware/Python-Apple-supporthttps://github.com/beeware/Python-Apple-support/blob/main/README.md
Use build_cpython_xcframework.sh to assemble a release asset from BeeWare's published support packages:
scripts/build_cpython_xcframework.shBy default the script:
- downloads BeeWare's macOS support package for
BEEWARE_TAG - downloads BeeWare's iOS support package for
BEEWARE_TAG - merges those frameworks into
build/cpython/CPython.xcframework - packages
build/cpython/CPython.xcframework.zip - prints the SwiftPM checksum
To auto-build and include a Mac Catalyst framework slice in the same pass:
BUILD_CATALYST=1 \
scripts/build_cpython_xcframework.shThis repo also includes a dedicated helper,
build_cpython_catalyst_framework.sh,
which builds a fat arm64 + x86_64 Python.framework for
*-apple-ios-macabi from official CPython sources plus BeeWare's published
macabi dependency archives. The builder defaults to a Mac Catalyst
deployment target of 13.1, which is the first Xcode-accepted macabi
triple:
scripts/build_cpython_catalyst_framework.shIf you already have a Catalyst framework, the XCFramework build still accepts a manual path override:
CPYTHON_CATALYST_FRAMEWORK_PATH=/abs/path/to/Python.framework \
REQUIRE_CATALYST=1 \
scripts/build_cpython_xcframework.shUse publish_cpython_release_asset.sh to build the SwiftPM artifact and upload it to a GitHub release:
GH_REPO=velos/Bash.swift \
RELEASE_TAG=cpython-3.13-b13 \
BEEWARE_TAG=3.13-b13 \
BUILD_CATALYST=1 \
scripts/publish_cpython_release_asset.shThe publish script:
- runs
build_cpython_xcframework.sh - writes
CPython.xcframework.checksum.txtandCPython.artifact-metadata.json - creates the target GitHub release tag if it does not already exist
- uploads
CPython.xcframework.zipplus checksum/metadata assets - prints the exact
Package.swiftbinaryTargetsnippet to use
The script expects GitHub CLI auth via GH_TOKEN/GITHUB_TOKEN.
For maintainers who prefer a manual UI entry point, this repo also includes
publish-cpython-artifact.yml,
which exposes a workflow_dispatch action with beeware_tag, optional
release_tag, and an include_catalyst toggle.
Producing a broader CPython.xcframework is only one part of iOS/Catalyst
support.
The official iOS packaging flow also requires:
- copying Python runtime files into the app bundle
- setting
PYTHONHOME - setting
PYTHONPATH - post-processing binary modules for App Store compliant framework layout
That means Bash.swift should not enable iOS or Mac Catalyst runtime support until the app-bundle packaging story is implemented as well.
To actually turn on runtime support beyond macOS, the package still needs:
- A packaging decision for SwiftPM linkage beyond macOS. SwiftPM can gate on
.iOS, but not specifically on Mac Catalyst, so widening the manifest would also pull CPython into plain iOS builds before the runtime bundle story is ready. - A resource/install story for mobile and Catalyst builds so the Python standard library is available at runtime.