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:
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.
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