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.0.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.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyto_pkg-2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 08776575c8a00bdc13c3e5f6b63bd3d1f76471f21ba959f69c5f477cb8c8125a
MD5 f98e346b861b02a23e262e033a1ef314
BLAKE2b-256 3da9fa1fc1a4161db0771da742910b9f60862fb37a340f502828246e7ea2587f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyto_pkg-2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a9839010f969e13bf0f5185b1edfb7c800577479459edcf58616287a30cb381
MD5 28342ec33855de68f76ec62096ed427a
BLAKE2b-256 8b448150e1c9ebbf5c2822934bbbd48098096ce17cda2a41d321ef78778387b2

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