Skip to content

Commit 6204046

Browse files
committed
Document iOS, Android and macOS platform tag schemes.
1 parent d844cdc commit 6204046

File tree

1 file changed

+63
-4
lines changed

1 file changed

+63
-4
lines changed

source/specifications/platform-compatibility-tags.rst

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ subset of Linux platforms, and allows building wheels tagged with the
109109
``manylinux`` platform tag which can be used across most common Linux
110110
distributions.
111111

112-
The current standard is the future-proof ``manylinux_x_y`` standard. It defines
113-
tags of the form ``manylinux_x_y_arch``, where ``x`` and ``y`` are glibc major
112+
The current standard is the future-proof ``manylinux_<x>_<y>`` standard. It defines
113+
tags of the form ``manylinux_<x>_<y>_<arch>``, where ``x`` and ``y`` are glibc major
114114
and minor versions supported (e.g. ``manylinux_2_24_xxx`` should work on any
115115
distro using glibc 2.24+), and ``arch`` is the architecture, matching the value
116116
of :py:func:`sysconfig.get_platform()` on the system as in the "simple" form above.
@@ -151,7 +151,7 @@ auditwheel ``>=1.0.0`` ``>=2.0.0`` ``>=3.0.0`` ``>=3.3.0`` [#
151151

152152
The ``musllinux`` family of tags is similar to ``manylinux``, but for Linux
153153
platforms that use the musl_ libc rather than glibc (a prime example being Alpine
154-
Linux). The schema is ``musllinux_x_y_arch``, supporting musl ``x.y`` and higher
154+
Linux). The schema is ``musllinux_<x>_<y>_<arch>``, supporting musl ``x.y`` and higher
155155
on the architecture ``arch``.
156156

157157
The musl version values can be obtained by executing the musl libc shared
@@ -189,6 +189,64 @@ There are currently two possible ways to find the musl library’s location that
189189
Python interpreter is running on, either with the system ldd_ command, or by
190190
parsing the ``PT_INTERP`` section’s value from the executable’s ELF_ header.
191191

192+
.. _macos:
193+
194+
macOS
195+
-----
196+
197+
macOS uses the ``macosx`` family of tags (the ``x`` suffix is a historical
198+
artefact of Apple's official macOS naming scheme). The schema for compatibility
199+
tags is ``macosx_<x>_<y>_<arch>``, indicating that the wheel is compatible with
200+
macOS ``x.y`` or later on the architecture ``arch``. The version number always
201+
includes a major and minor version, even if Apple's official version numbering
202+
only refers to the major value. For example, a ``macosx_11_0_arm64`` indicates
203+
compatibility with macOS 11 or later, on arm64 (i.e., Apple Silicon) hardware.
204+
205+
Recent macOS binaries distributed on Python.org are compiled with a minimum
206+
macOS compatibility version of 11.0, as macOS 11 (Big Sur) was the first release
207+
to support the ARM64 Apple Silicon architecture. Python binaries obtained from
208+
other sources may have a different compatibility version.
209+
210+
macOS also supports the use of a combined, or "fat" architecture specification.
211+
For example, specifying an architecture of ``universal2`` indicates that
212+
binaries support *both* x86_64 *and* arm64.
213+
214+
.. _android:
215+
216+
android
217+
-------
218+
219+
Android uses the schema ``android_<sdk>_<arch>``, indicating compatibility with
220+
Android SDK ``sdk`` or later, on the architecture ``arch``. Android makes no
221+
distinction between physical devices and emulated devices.
222+
223+
Note that this tag schema uses the *SDK* version, not the Android OS version
224+
number. The Android release known publicly as Android 12 (code named "Snow
225+
Cone") uses SDK 31 or 32, depending on the specific Android version in use.
226+
Android's release documentation contains the `full list of Android versions and
227+
their corresponding SDK versions
228+
<https://developer.android.com/tools/releases/platforms>`__.
229+
230+
By default, Python 3.13 is compiled using SDK 24 (i.e, Android 7); Python 3.14
231+
uses SDK 27 (i.e, Android 8.1).
232+
233+
.. _ios:
234+
235+
iOS
236+
---
237+
238+
iOS uses the schema ``ios_<x>_<y>_<arch>_<sdk>``, indicating compatibility with
239+
iOS ``x.y`` or later, on the ``arch`` architecture, using the ``sdk`` SDK. The
240+
version number always includes a major and minor version, even if Apple's
241+
official version numbering only refers to the major value.
242+
243+
The iOS platform has two SDKs: ``iphoneos`` for physical devices; and
244+
``iphonesimulator`` for simulated devices. These SDKs have the same API surface,
245+
but are incompatible at the binary level, even if they are running on the same
246+
architecture. Code compiled for an arm64 simulator will not run on an arm64
247+
device.
248+
249+
By default, Python is compiled with a minimum iOS compatibility version of 13.0.
192250

193251
Use
194252
===
@@ -339,7 +397,8 @@ History
339397
- November 2019: The ``manylinux_x_y`` perennial tag was approved through
340398
:pep:`600`.
341399
- April 2021: The ``musllinux_x_y`` tag was approved through :pep:`656`.
342-
400+
- December 2023: The tags for iOS were approved through :pep:`730`.
401+
- March 2024: The tags for Android were approved through :pep:`738`.
343402

344403

345404
.. _musl: https://musl.libc.org

0 commit comments

Comments
 (0)