Skip to main content

pyto-pkg

Python command line utility that installs wheels into Swift packages. Scripts are shared accross platforms (even when installed from wheels), but extensions are installed in os specific Apple Frameworks only if a supported wheel is found. The installed platforms are written in *.dist-info/platforms.txt.

This does not provide a cross compilation environment and is only meant to be used to install wheels and pure Python packages.

Also, this is made to work with pyto-runtime so tagging works differently than the official iOS wheels.

Supported platforms are: ios, ios-simulator, ios-macabi, tvos, tvos-simulator, watchos and watchos-simulator. Wheels must not contain the minimum os version or the llvm platform name. Example of valid wheel name: numpy-2.3.0-cp314-cp314-ios_arm64.whl.

Usage

$ pip install pyto-pkg
$ pyto-pkg --output SwiftPackagePath install numpy

The python version used to run pyto-pkg will be the version running pip. You can configure multiple Python versions with different packages in a single Swift Package.

You can pass a requirements file with -r. By default, pyto-pkg installs wheels for all supported platforms, but you can specify them with the -t argument, or you can customize them by package by adding a coma after the package name or version. Then you can write the platforms name, followed by an underscore and the architecture separated by a coma. If you want to just exclude a platform, put an exclamation mark before the platform name. For example:

opencv-contrib-python==4.13.0+d87edc6,!watchos_armv7k
torch==2.8.0a0+gitde3aca3,ios_arm64,ios-macabi_arm64,ios-macabi_x86_64

Pass --help for more options. By default, wheels will be pulled from https://git.gatit.es/api/packages/pyto/pypi/simple but you can change it with --index-url. Wheels are preferred over tar balls and pip will fallback to the default index repository if no wheels or packages are found in the specified repo index. You can also skip scripts with --no-scripts so you can pip install the wheels at runtime while keeping the extensions. However you need to be sure that the version of the package installed at runtime matches the version of the extensions stored in the app bundle.

Adding dependencies

You can pass a custom Package.swift manifest template path with the --manifest option so you can add your own dependencies. This is what your template should include:

// swift-tools-version: 5.9

import PackageDescription

let package = Package(
    name: "%PACKAGE_NAME%",
    products: [
        .library(
            name: "%TARGET_NAME%",
            targets: ["%TARGET_NAME%"]),
    ],

    targets: [
        .target(
            name: "%TARGET_NAME%",
            dependencies: [
%FRAMEWORK_DEPENDENCIES%
            ],
            resources: [
%RESOURCES%
            ]),

%FRAMEWORKS%
    ]
)

Metadata

Release files for pyto-pkg 2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyto-pkg 2.6
File Size Uploaded Provenance Actions
pyto_pkg-2.6.tar.gz 12.6 kB Without provenance Details for pyto_pkg-2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyto-pkg 2.6
File Interpreter ABI Platform Actions
pyto_pkg-2.6-py3-none-any.whl Python 3 none any Details for pyto_pkg-2.6-py3-none-any.whl

Total release size: 27.3 kB

Release files / pyto_pkg-2.6.tar.gz

Download URL pyto_pkg-2.6.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2e9d630c27644ce90ad7572fc1ab5acef2ff49e6f00837e9a51f19b4275ee6a3
BLAKE2b-256 checksum
How to use checksums
ae4afca431f7ffcb4e66f30fdd87c9af44441d5f6bad1b2e6678151b31aa4ee5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / pyto_pkg-2.6-py3-none-any.whl

Download URL pyto_pkg-2.6-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea69624b3b25dbb41cd190101485651c79eb503c22d0d39b932e492dfbb9c3d0
BLAKE2b-256 checksum
How to use checksums
3cdadeb372a7125c97bb0193d0a332fb6d4a4bf09b3d09ce51c06a9756311db1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for pyto-pkg 2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page