@@ -2,7 +2,7 @@ Python Apple Support
2
2
====================
3
3
4
4
This is a meta-package for building a version of Python that can be embedded
5
- into a macOS, iOS, tvOS or watchOS project.
5
+ into a macOS, iOS, tvOS, watchOS, or visionOS project.
6
6
7
7
**This branch builds a packaged version of Python 3.14 **.
8
8
Other Python versions are available by cloning other branches of the main
@@ -16,21 +16,24 @@ repository:
16
16
17
17
It works by downloading, patching, and building a fat binary of Python and
18
18
selected pre-requisites, and packaging them as frameworks that can be
19
- incorporated into an XCode project. The binary modules in the Python standard
19
+ incorporated into an Xcode project. The binary modules in the Python standard
20
20
library are distributed as binaries that can be dynamically loaded at runtime.
21
21
22
22
The macOS package is a re-bundling of the official macOS binary, modified so that
23
23
it is relocatable, with the IDLE, Tkinter and turtle packages removed, and the
24
24
App Store compliance patch applied.
25
25
26
- The iOS, tvOS and watchOS packages compiled by this project use the official
27
- `PEP 730 <https://peps.python.org/pep-0730/ >`__ code that is part of Python 3.13
28
- to provide iOS support; the relevant patches have been backported to 3.9-3.12.
29
- Additional patches have been applied to add tvOS and watchOS support.
26
+ The iOS, tvOS, watchOS, and visionOS packages compiled by this project use the
27
+ official `PEP 730 <https://peps.python.org/pep-0730/ >`__ code that is part of
28
+ Python 3.13 to provide iOS support; the relevant patches have been backported
29
+ to 3.9-3.12. Additional patches have been applied to add tvOS, watchOS, and
30
+ visionOS support.
30
31
31
32
The binaries support x86_64 and arm64 for macOS; arm64 for iOS and appleTV
32
- devices; and arm64_32 for watchOS devices. It also supports device simulators on
33
- both x86_64 and M1 hardware. This should enable the code to run on:
33
+ devices; arm64_32 for watchOS devices; and arm64 for visionOS devices. It also
34
+ supports device simulators on both x86_64 and M1 hardware, except for visionOS,
35
+ for which x86_64 simulators are officially unsupported. This should enable the
36
+ code to run on:
34
37
35
38
* macOS 11 (Big Sur) or later, on:
36
39
* MacBook (including MacBooks using Apple Silicon)
@@ -49,6 +52,8 @@ both x86_64 and M1 hardware. This should enable the code to run on:
49
52
* Apple TV (4th gen or later)
50
53
* watchOS 4.0 or later, on:
51
54
* Apple Watch (4th gen or later)
55
+ * visionOS 2.0 or later, on:
56
+ * Apple Vision Pro
52
57
53
58
Quickstart
54
59
----------
@@ -69,23 +74,24 @@ repository, and then in the root directory, and run:
69
74
* ``make iOS `` to build everything for iOS.
70
75
* ``make tvOS `` to build everything for tvOS.
71
76
* ``make watchOS `` to build everything for watchOS.
77
+ * ``make visionOS `` to build everything for visionOS.
72
78
73
79
This should:
74
80
75
81
1. Download the original source packages
76
82
2. Patch them as required for compatibility with the selected OS
77
83
3. Build the packages as Xcode-compatible XCFrameworks.
78
84
79
- The resulting support packages will be packaged as a ``.tar.gz `` file
85
+ The resulting support packages will be packaged as ``.tar.gz `` files
80
86
in the ``dist `` folder.
81
87
82
88
Each support package contains:
83
89
84
90
* ``VERSIONS ``, a text file describing the specific versions of code used to build the
85
91
support package;
86
- * ``Python.xcframework ``, a multi-architecture build of the Python runtime library
92
+ * ``Python.xcframework ``, a multi-architecture build of the Python runtime library.
87
93
88
- On iOS/tvOS/watchOS, the ``Python.xcframework `` contains a
94
+ On iOS/tvOS/watchOS/visionOS , the ``Python.xcframework `` contains a
89
95
slice for each supported ABI (device and simulator). The folder containing the
90
96
slice can also be used as a ``PYTHONHOME ``, as it contains a ``bin ``, ``include ``
91
97
and ``lib `` directory.
@@ -96,11 +102,11 @@ needed to build packages. This is required because Xcode uses the ``xcrun``
96
102
alias to dynamically generate the name of binaries, but a lot of C tooling
97
103
expects that ``CC `` will not contain spaces.
98
104
99
- Each slice of an iOS/tvOS/watchOS XCframework also contains a
105
+ Each slice of an iOS/tvOS/watchOS/visionOS XCframework also contains a
100
106
``platform-config `` folder with a subfolder for each supported architecture in
101
107
that slice. These subfolders can be used to make a macOS Python environment
102
- behave as if it were on an iOS/tvOS/watchOS device. This works in one of two
103
- ways:
108
+ behave as if it were on an iOS/tvOS/watchOS/visionOS device. This works in one
109
+ of two ways:
104
110
105
111
1. **A sitecustomize.py script **. If the ``platform-config `` subfolder is on
106
112
your ``PYTHONPATH `` when a Python interpreter is started, a site
@@ -116,9 +122,9 @@ ways:
116
122
environment to build a wheel, these patches will also be applied to the
117
123
isolated build environment that is created.
118
124
119
- iOS distributions also contain a copy of the iOS `` testbed `` project - an Xcode
120
- project that can be used to run test suites of Python code. See the ` CPython
121
- documentation on testing packages
125
+ iOS and visionOS distributions also contain a copy of the iOS or visionOS
126
+ `` testbed `` project - an Xcode project that can be used to run test suites of
127
+ Python code. See the ` CPython documentation on testing packages
122
128
<https://docs.python.org/3/using/ios.html#testing-a-python-package> `__ for
123
129
details on how to use this testbed.
124
130
@@ -131,8 +137,8 @@ Building binary wheels
131
137
This project packages the Python standard library, but does not address building
132
138
binary wheels. Binary wheels for macOS can be obtained from PyPI. `Mobile Forge
133
139
<https://github.com/beeware/mobile-forge> `__ is a project that provides the
134
- tooling to build build binary wheels for iOS (and potentially for tvOS and
135
- watchOS , although that hasn't been tested).
140
+ tooling to build build binary wheels for iOS (and potentially for tvOS, watchOS,
141
+ and visionOS , although that hasn't been tested).
136
142
137
143
Historical support
138
144
------------------
0 commit comments