Skip to main content

Python command line utility that installs wheels into Swift packages.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyto_pkg-2.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyto_pkg-2.1-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file pyto_pkg-2.1.tar.gz.

File metadata

  • Download URL: pyto_pkg-2.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pyto_pkg-2.1.tar.gz
Algorithm Hash digest
SHA256 748bf828ed4a7a4a98e55a9264a2cc62afcefcc49c6b814715482504426ceefa
MD5 6c3df69e65bc666915e5cff7673be977
BLAKE2b-256 1d398be8eaeab45ae927ebd1b475867cfdc51df4f70cdc0a73a65906e3a8662c

See more details on using hashes here.

File details

Details for the file pyto_pkg-2.1-py3-none-any.whl.

File metadata

  • Download URL: pyto_pkg-2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pyto_pkg-2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8e6190ac243493547700771b3cc79ceab39dc0d69304461b6ab0b7effb25f8c0
MD5 eed8ee1f22d912e87689ab44e783071c
BLAKE2b-256 f8a526756d8d617f22e920f433ab3a06da6a4055dcccff2037a520aaa7efb7dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page