Ship your app

Package and distribute your app

Embed one matched runtime, bundle your Python dependencies, and sign the complete app.

Keep one release together.

Pin the runtime exactly. Use the worker, optional audio helper and VM assets from that same release. Check the finished app bundle for each required executable and framework.

Embed the runtime dependencies

The public SwiftPM products depend on the package-owned Python runtime and the private Engine binary. Xcode handles framework linkage through the package graph. Do not import Engine, select a host interpreter or add custom Python linker flags.

For a worker-enabled app, the documented layout includes:

text
YourApp.app/
  Contents/
    Frameworks/
      SwiftPythonEngine.framework/
      Python.framework/
    MacOS/
      YourApp
      SwiftPythonWorker

Embed Engine once. The app must resolve it through its Frameworks directory. Sign nested code before signing the outer application.

Add the Python packages your app uses

Bundle packages for the supplied Python 3.13 runtime and the architecture you distribute. Preserve their license notices. NumPy, SciPy and scikit-learn are bundled by the example builders; they are not installed automatically by the runtime product.

The public examples use hash-locked wheels and sign their native extensions before sealing the application. Use those builders as packaging references for your app.

Host workers in XPC services or extensions

The package includes SwiftPythonWorkerService and a consumer kit for app-owned workers. Download the complete distribution and manifest.json from the stable 0.7.0 release, then follow the consumer guide to generate, build, sign and run your application.

The XPC recipe supports macOS 15 or later with a nonsandboxed service. ExtensionFoundation hosting requires macOS 26 and uses a sandboxed worker extension. The parent application's sandbox policy is selected separately. Build scripts require Python 3.9 or later, XcodeGen and the appropriate Xcode SDK; the installed app uses the bundled Python runtime.

Use the intact release archive for assembly. The release inventory covers the kit's documentation as well as its code, while GitHub may carry newer guides.

Adopt the 0.7.0 security update

Ship the matched runtime and worker together. Native shared-ring streaming now requires a worker that declares stream.atomic-ring.v1; older workers are refused safely for this operation. Rebuild VM images to include the patched Python 3.12.15 and current trust inputs.

Refresh app-owned Python environments to use pip 26.2.2 or newer and certifi 2026.10.19 or newer. Adopting the SDK does not update existing installed apps or their virtual environments. See the release notes for the bundled Python 3.13.17 security backports and trust changes.

Configure sandboxed Python IPC

Python child processes use the interpreter packaged with the app. For sandboxed Python multiprocessing, shared memory and managed tensors, sign the parent app with an application group of at most 17 bytes, such as TEAMID.ipc. If the app declares several groups, select the short one with SwiftPythonIPCApplicationGroup in its Info.plist. Missing or unusable declarations fail with an error identifying the required group. Follow the same-release entitlement templates and consumer guide.

Add optional components

Feature Extra integration
Audio adapter Link SwiftPythonAudioInterop. Configure your app's audio permissions and entitlements.
Audio hardware probe Embed the same-release SwiftPythonAudioProbe at Contents/MacOS/SwiftPythonAudioProbe and sign it as nested code. SwiftPM does not auto-embed this raw executable.
Metal adapter Link SwiftPythonMetalInterop and preserve GPU buffer ownership through completion.
Linux sandboxes Provide the matched runtime asset, helpers and any checkpoint; configure the virtualization entitlement on Apple Silicon.

Verify the distributed application

Test the actual packaged app on a machine or environment that does not supply your development Python installation. Verify imports, worker startup, model work and shutdown. Developer ID distribution also needs signing, notarization and Gatekeeper verification for the finished app.

The public distribution guide contains the signing rules and entitlement templates. App Sandbox and hardened-runtime deployments have different requirements; choose the documented path for your application.

Read the complete distribution guide · Entitlement templates