Skip to content

Update #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 129 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
7d98284
Extract binary dependencies into external repositories.
freakboy3742 Oct 27, 2023
4b7189e
Updated Actions workflows to use modern APIs.
freakboy3742 Oct 27, 2023
c3cefc9
Use -dev python releases in dev branch.
freakboy3742 Oct 27, 2023
184ca2c
Correct the naming of outputs.
freakboy3742 Oct 27, 2023
7431428
Bump setup-python action version.
freakboy3742 Oct 27, 2023
ba8baa7
Make clean cross-version safe.
freakboy3742 Oct 27, 2023
f0c1acd
Extract macOS framework from official binary release.
freakboy3742 Nov 1, 2023
9ef6e91
Modify build process to generate frameworks for iOS/tvOS/watchOS.
freakboy3742 Nov 14, 2023
b8fcfd7
Update docs describing the framework build and usage.
freakboy3742 Nov 14, 2023
323aa5f
Update syntax for github outputs.
freakboy3742 Nov 20, 2023
252d48b
Add a makefile target to extract the Makefile config.
freakboy3742 Nov 20, 2023
6ec85e7
Add a CI workflow.
freakboy3742 Nov 20, 2023
55cf5f9
Add other platforms into CI check.
freakboy3742 Nov 21, 2023
fd7051e
Upload build artefacts as part of CI.
freakboy3742 Nov 21, 2023
6d6abb0
Add a non-executable stub binary for crossenv detection purposes.
freakboy3742 Nov 22, 2023
c0cc333
Updated patch with version that passes CPython CI.
freakboy3742 Dec 4, 2023
ee70f59
Bump actions/setup-python from 4.7.1 to 5.0.0
dependabot[bot] Dec 10, 2023
35dca49
Merge pull request #194 from beeware/dependabot/github_actions/action…
freakboy3742 Dec 10, 2023
a49a33f
Upgrade `upload-artifact` and `download-artifact` actions to v4
rmartin16 Jan 3, 2024
2aa2aed
Merge pull request #197 from beeware/ci
freakboy3742 Jan 5, 2024
616ef71
Bump actions/download-artifact from 4.1.0 to 4.1.1
dependabot[bot] Jan 11, 2024
b4947bd
Merge pull request #199 from beeware/dependabot/github_actions/action…
freakboy3742 Jan 11, 2024
13b0ef2
Bump actions/upload-artifact from 4.0.0 to 4.1.0
dependabot[bot] Jan 14, 2024
eb55146
Merge pull request #200 from beeware/dependabot/github_actions/action…
freakboy3742 Jan 14, 2024
7021216
Bump actions/upload-artifact from 4.1.0 to 4.2.0
dependabot[bot] Jan 21, 2024
8b8eb0e
Merge pull request #202 from beeware/dependabot/github_actions/action…
freakboy3742 Jan 24, 2024
eebe6e3
Bump actions/upload-artifact from 4.2.0 to 4.3.0
dependabot[bot] Jan 28, 2024
dd83086
Merge pull request #203 from beeware/dependabot/github_actions/action…
freakboy3742 Jan 29, 2024
0200ce5
Bump actions/download-artifact from 4.1.1 to 4.1.2
dependabot[bot] Feb 11, 2024
7cd7971
Bump actions/upload-artifact from 4.3.0 to 4.3.1
dependabot[bot] Feb 11, 2024
09f628d
Bump ncipollo/release-action from 1.13.0 to 1.14.0
dependabot[bot] Feb 11, 2024
139f221
Merge pull request #206 from beeware/dependabot/github_actions/ncipol…
freakboy3742 Feb 11, 2024
6a7eb7e
Merge pull request #205 from beeware/dependabot/github_actions/action…
freakboy3742 Feb 11, 2024
a7a44d3
Merge pull request #204 from beeware/dependabot/github_actions/action…
freakboy3742 Feb 11, 2024
1d48204
Bump actions/download-artifact from 4.1.2 to 4.1.4
dependabot[bot] Mar 3, 2024
44615ed
Merge pull request #208 from beeware/dependabot/github_actions/action…
freakboy3742 Mar 4, 2024
05aa1d0
Bump actions/setup-python from 5.0.0 to 5.1.0
dependabot[bot] Mar 31, 2024
195baec
Merge pull request #211 from beeware/dependabot/github_actions/action…
freakboy3742 Apr 1, 2024
85adfc8
add disabling dead code stripping in linker
tnymlr Apr 9, 2024
a7376a4
Merge pull request #212 from tnymlr/patch-1
freakboy3742 Apr 9, 2024
e9bdc36
Bump actions/upload-artifact from 4.3.1 to 4.3.2
dependabot[bot] Apr 21, 2024
1262ebd
Bump actions/download-artifact from 4.1.4 to 4.1.5
dependabot[bot] Apr 21, 2024
36f7c17
Merge pull request #213 from beeware/dependabot/github_actions/action…
freakboy3742 Apr 22, 2024
fbbb23a
Merge pull request #214 from beeware/dependabot/github_actions/action…
freakboy3742 Apr 22, 2024
995e9d7
Bump actions/download-artifact from 4.1.5 to 4.1.7
dependabot[bot] Apr 28, 2024
7948bde
Bump actions/upload-artifact from 4.3.2 to 4.3.3
dependabot[bot] Apr 28, 2024
c6f8378
Merge pull request #216 from beeware/dependabot/github_actions/action…
freakboy3742 Apr 28, 2024
d8c52ee
Merge pull request #215 from beeware/dependabot/github_actions/action…
freakboy3742 Apr 28, 2024
580f397
Bump actions/upload-artifact from 4.3.3 to 4.3.4
dependabot[bot] Jul 7, 2024
0fadbb3
Bump actions/download-artifact from 4.1.7 to 4.1.8
dependabot[bot] Jul 7, 2024
bdc6ba7
Merge pull request #222 from beeware/dependabot/github_actions/action…
freakboy3742 Jul 11, 2024
1748fe9
Merge pull request #223 from beeware/dependabot/github_actions/action…
freakboy3742 Jul 11, 2024
b3f9b1a
Bump actions/setup-python from 5.1.0 to 5.1.1
dependabot[bot] Jul 14, 2024
62237a5
Merge pull request #224 from beeware/dependabot/github_actions/action…
freakboy3742 Jul 14, 2024
493dc76
Merge branch 'main' into framework-lib
freakboy3742 Jul 25, 2024
c53d7bd
Update to final state of PEP730 patches.
freakboy3742 Jul 26, 2024
ad578a9
Use a branch version of Briefcase.
freakboy3742 Jul 30, 2024
8a0cd42
Add a timeout for iOS testing.
freakboy3742 Jul 30, 2024
7c94895
Merge pull request #191 from beeware/framework-lib
freakboy3742 Jul 30, 2024
554a58a
Bump actions/upload-artifact from 4.3.4 to 4.3.5
dependabot[bot] Aug 4, 2024
119732a
Merge pull request #225 from beeware/dependabot/github_actions/action…
freakboy3742 Aug 4, 2024
d4978e3
Update patch to 3.13.0rc1
freakboy3742 Aug 5, 2024
912f2d9
Include the app store compliance patch.
freakboy3742 Aug 5, 2024
ff5adbb
Remove tool definitions from configure invocation.
freakboy3742 Aug 5, 2024
68ea0fe
Differentiate the binary package version number from the source versi…
freakboy3742 Aug 6, 2024
600b9e0
Normalize ordering of dependent libraries.
freakboy3742 Aug 6, 2024
5e37c10
Rework CI and release workflows to maximize reuse.
freakboy3742 Aug 6, 2024
723d516
Correct artefact pattern for releases.
freakboy3742 Aug 7, 2024
8b5fb4e
Correct Python version variable in publication script.
freakboy3742 Aug 7, 2024
6be4cff
Bump actions/upload-artifact from 4.3.5 to 4.3.6
dependabot[bot] Aug 11, 2024
f66bbaf
Merge pull request #227 from beeware/dependabot/github_actions/action…
freakboy3742 Aug 11, 2024
070ee96
Revert TODOs related to in-progress briefcase work.
freakboy3742 Aug 16, 2024
132f9dc
Bump actions/setup-python from 5.1.1 to 5.2.0
dependabot[bot] Sep 1, 2024
3b95db4
Bump actions/upload-artifact from 4.3.6 to 4.4.0
dependabot[bot] Sep 1, 2024
517e86b
Merge pull request #231 from beeware/dependabot/github_actions/action…
freakboy3742 Sep 1, 2024
6622e17
Merge pull request #232 from beeware/dependabot/github_actions/action…
freakboy3742 Sep 1, 2024
18766a7
Merge pull request #228 from beeware/revert-todos
freakboy3742 Sep 5, 2024
a0f789d
Update patch for v3.13.0rc2.
freakboy3742 Sep 9, 2024
e742508
Ensure dylibs and macOS packaging confirmation files aren't included …
freakboy3742 Sep 9, 2024
dd2c44b
Remove micro version from README note.
freakboy3742 Sep 9, 2024
d8fdaae
Strip xattrs from macOS bundle before archiving.
freakboy3742 Sep 10, 2024
eae365e
Bump to 3.13.0.
freakboy3742 Oct 9, 2024
e3f0bc0
Bump actions/upload-artifact from 4.4.0 to 4.4.3
dependabot[bot] Oct 13, 2024
0717ddb
Merge pull request #235 from beeware/dependabot/github_actions/action…
freakboy3742 Oct 14, 2024
75dd5e3
Add ios_ver and _multiarch shims for pip 24.3 support.
freakboy3742 Oct 28, 2024
c8da2e9
Merge pull request #237 from beeware/ios-ver-sitecustom
freakboy3742 Oct 28, 2024
187c64a
Bump actions/setup-python from 5.2.0 to 5.3.0
dependabot[bot] Oct 28, 2024
c854c71
Merge pull request #236 from beeware/dependabot/github_actions/action…
freakboy3742 Oct 28, 2024
6f5fa58
Switch main branch to Python 3.14.
freakboy3742 Dec 13, 2024
7c9ec06
Fixes #239 - Purge .orig files from release packages.
freakboy3742 Dec 13, 2024
5eb3316
Include iOS testbed in iOS release artefacts.
freakboy3742 Dec 13, 2024
5ca1c79
Update build to use 3.14.0a3
freakboy3742 Dec 17, 2024
42a4a13
Bump actions/upload-artifact from 4.4.3 to 4.5.0
dependabot[bot] Dec 22, 2024
23ea419
Merge pull request #242 from beeware/dependabot/github_actions/action…
freakboy3742 Dec 22, 2024
dad62c3
Bump actions/upload-artifact from 4.5.0 to 4.6.0 (#244)
dependabot[bot] Jan 13, 2025
6d5096d
Bump ncipollo/release-action from 1.14.0 to 1.15.0 (#243)
dependabot[bot] Jan 13, 2025
a3ffcad
Update patch to 3.14.0a4.
freakboy3742 Feb 3, 2025
e6682a4
Bump actions/setup-python from 5.3.0 to 5.4.0 (#245)
dependabot[bot] Feb 3, 2025
a2c04c3
Bump patch to Python3.14.0a5. (#247)
freakboy3742 Feb 13, 2025
c82aa70
Modify handling of platform site to allow for venv usage. (#246)
freakboy3742 Feb 14, 2025
5cd3512
Improve support for PythonKit, and update usage guide (#248)
freakboy3742 Feb 14, 2025
3a7cd86
More updates to USAGE and README (#250)
freakboy3742 Feb 17, 2025
1158013
Bump ncipollo/release-action from 1.15.0 to 1.16.0 (#253)
dependabot[bot] Feb 23, 2025
832d393
Bump actions/upload-artifact from 4.6.0 to 4.6.1 (#254)
dependabot[bot] Feb 23, 2025
aa545e9
Add patch for handling empty simulator lists.
freakboy3742 Feb 25, 2025
c794b06
Bump actions/download-artifact from 4.1.8 to 4.1.9 (#255)
dependabot[bot] Mar 3, 2025
0013ca0
Update patch for Python 3.14.0a6 (#258)
freakboy3742 Mar 18, 2025
ca43143
Bump actions/download-artifact from 4.1.9 to 4.2.1 (#265)
dependabot[bot] Mar 23, 2025
cfd548d
Bump actions/upload-artifact from 4.6.1 to 4.6.2 (#266)
dependabot[bot] Mar 23, 2025
db04fbd
Bump actions/setup-python from 5.4.0 to 5.5.0 (#267)
dependabot[bot] Mar 30, 2025
81428db
Add Python.patch Note to Contributing.md (#271)
johnzhou721 Apr 17, 2025
92d8d95
Add support for visionOS (#270)
johnzhou721 Apr 23, 2025
f8fd686
Fix an iOS reference in testbed cloning. (#272)
johnzhou721 Apr 23, 2025
344aaf6
Update patch to include visionOS plist changes.
freakboy3742 Apr 25, 2025
515625c
visionOS Support and Other Fixes (#276)
johnzhou721 Apr 27, 2025
e29c0fd
Bump actions/setup-python from 5.5.0 to 5.6.0 (#277)
dependabot[bot] Apr 27, 2025
80296f0
Bump actions/download-artifact from 4.2.1 to 4.3.0 (#278)
dependabot[bot] Apr 27, 2025
b5bed64
Ensure base_prefix is set in a cross-venv. (#279)
freakboy3742 May 1, 2025
7a7aad1
Document the Patch Tree Approach. (#281)
johnzhou721 May 4, 2025
6583edf
Update CONTRIBUTING.md for Grammar + Clarity (#282)
johnzhou721 May 4, 2025
a041905
Remove some useless PATHs in Usage.md (#284)
johnzhou721 May 6, 2025
76b7f30
Bump patch to Python 3.14.0b2. (#290)
freakboy3742 Jun 3, 2025
c012e5d
Add xcprivacy and dSYM handling (#285)
freakboy3742 Jun 3, 2025
8019835
Temporarily disable dSYM production. (#293)
freakboy3742 Jun 3, 2025
a7aaafe
Correct issues with testing in CI (#295)
freakboy3742 Jun 4, 2025
119de47
Correct handling of sysconfig._BASE_PREFIX in cross environments. (#297)
freakboy3742 Jun 6, 2025
5b1bb20
Bump ncipollo/release-action from 1.16.0 to 1.17.0 (#299)
dependabot[bot] Jun 29, 2025
6366590
Bump ncipollo/release-action from 1.17.0 to 1.18.0 (#300)
dependabot[bot] Jul 6, 2025
42c9975
Fix markdown (#302)
johnzhou721 Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
visionOS Support and Other Fixes (beeware#276)
Add documentation for visionOS support.
  • Loading branch information
johnzhou721 authored Apr 27, 2025
commit 515625c54edf15843d503ba00d1bc2e0e6b9f5e9
44 changes: 25 additions & 19 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Python Apple Support
====================

This is a meta-package for building a version of Python that can be embedded
into a macOS, iOS, tvOS or watchOS project.
into a macOS, iOS, tvOS, watchOS, or visionOS project.

**This branch builds a packaged version of Python 3.14**.
Other Python versions are available by cloning other branches of the main
Expand All @@ -16,21 +16,24 @@ repository:

It works by downloading, patching, and building a fat binary of Python and
selected pre-requisites, and packaging them as frameworks that can be
incorporated into an XCode project. The binary modules in the Python standard
incorporated into an Xcode project. The binary modules in the Python standard
library are distributed as binaries that can be dynamically loaded at runtime.

The macOS package is a re-bundling of the official macOS binary, modified so that
it is relocatable, with the IDLE, Tkinter and turtle packages removed, and the
App Store compliance patch applied.

The iOS, tvOS and watchOS packages compiled by this project use the official
`PEP 730 <https://peps.python.org/pep-0730/>`__ code that is part of Python 3.13
to provide iOS support; the relevant patches have been backported to 3.9-3.12.
Additional patches have been applied to add tvOS and watchOS support.
The iOS, tvOS, watchOS, and visionOS packages compiled by this project use the
official `PEP 730 <https://peps.python.org/pep-0730/>`__ code that is part of
Python 3.13 to provide iOS support; the relevant patches have been backported
to 3.9-3.12. Additional patches have been applied to add tvOS, watchOS, and
visionOS support.

The binaries support x86_64 and arm64 for macOS; arm64 for iOS and appleTV
devices; and arm64_32 for watchOS devices. It also supports device simulators on
both x86_64 and M1 hardware. This should enable the code to run on:
devices; arm64_32 for watchOS devices; and arm64 for visionOS devices. It also
supports device simulators on both x86_64 and M1 hardware, except for visionOS,
for which x86_64 simulators are officially unsupported. This should enable the
code to run on:

* macOS 11 (Big Sur) or later, on:
* MacBook (including MacBooks using Apple Silicon)
Expand All @@ -49,6 +52,8 @@ both x86_64 and M1 hardware. This should enable the code to run on:
* Apple TV (4th gen or later)
* watchOS 4.0 or later, on:
* Apple Watch (4th gen or later)
* visionOS 2.0 or later, on:
* Apple Vision Pro

Quickstart
----------
Expand All @@ -69,23 +74,24 @@ repository, and then in the root directory, and run:
* ``make iOS`` to build everything for iOS.
* ``make tvOS`` to build everything for tvOS.
* ``make watchOS`` to build everything for watchOS.
* ``make visionOS`` to build everything for visionOS.

This should:

1. Download the original source packages
2. Patch them as required for compatibility with the selected OS
3. Build the packages as Xcode-compatible XCFrameworks.

The resulting support packages will be packaged as a ``.tar.gz`` file
The resulting support packages will be packaged as ``.tar.gz`` files
in the ``dist`` folder.

Each support package contains:

* ``VERSIONS``, a text file describing the specific versions of code used to build the
support package;
* ``Python.xcframework``, a multi-architecture build of the Python runtime library
* ``Python.xcframework``, a multi-architecture build of the Python runtime library.

On iOS/tvOS/watchOS, the ``Python.xcframework`` contains a
On iOS/tvOS/watchOS/visionOS, the ``Python.xcframework`` contains a
slice for each supported ABI (device and simulator). The folder containing the
slice can also be used as a ``PYTHONHOME``, as it contains a ``bin``, ``include``
and ``lib`` directory.
Expand All @@ -96,11 +102,11 @@ needed to build packages. This is required because Xcode uses the ``xcrun``
alias to dynamically generate the name of binaries, but a lot of C tooling
expects that ``CC`` will not contain spaces.

Each slice of an iOS/tvOS/watchOS XCframework also contains a
Each slice of an iOS/tvOS/watchOS/visionOS XCframework also contains a
``platform-config`` folder with a subfolder for each supported architecture in
that slice. These subfolders can be used to make a macOS Python environment
behave as if it were on an iOS/tvOS/watchOS device. This works in one of two
ways:
behave as if it were on an iOS/tvOS/watchOS/visionOS device. This works in one
of two ways:

1. **A sitecustomize.py script**. If the ``platform-config`` subfolder is on
your ``PYTHONPATH`` when a Python interpreter is started, a site
Expand All @@ -116,9 +122,9 @@ ways:
environment to build a wheel, these patches will also be applied to the
isolated build environment that is created.

iOS distributions also contain a copy of the iOS ``testbed`` project - an Xcode
project that can be used to run test suites of Python code. See the `CPython
documentation on testing packages
iOS and visionOS distributions also contain a copy of the iOS or visionOS
``testbed`` project - an Xcode project that can be used to run test suites of
Python code. See the `CPython documentation on testing packages
<https://docs.python.org/3/using/ios.html#testing-a-python-package>`__ for
details on how to use this testbed.

Expand All @@ -131,8 +137,8 @@ Building binary wheels
This project packages the Python standard library, but does not address building
binary wheels. Binary wheels for macOS can be obtained from PyPI. `Mobile Forge
<https://github.com/beeware/mobile-forge>`__ is a project that provides the
tooling to build build binary wheels for iOS (and potentially for tvOS and
watchOS, although that hasn't been tested).
tooling to build build binary wheels for iOS (and potentially for tvOS, watchOS,
and visionOS, although that hasn't been tested).

Historical support
------------------
Expand Down
13 changes: 7 additions & 6 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## The easy way

The easist way to use these packages is by creating a project with `Briefcase
<https://github.com/beeware/briefcase>`__. Briefcase will download pre-compiled
versions of these support packages, and add them to an Xcode project (or
pre-build stub application, in the case of macOS).
The easist way to use these packages is by creating a project with
(Briefcase)[https://github.com/beeware/briefcase]. Briefcase will download
pre-compiled versions of these support packages, and add them to an Xcode project
(or pre-build stub application, in the case of macOS).

## The manual way

Expand All @@ -22,8 +22,9 @@ guides:
* [macOS](https://docs.python.org/3/using/mac.html)
* [iOS](https://docs.python.org/3/using/ios.html#adding-python-to-an-ios-project)

For tvOS and watchOS, you should be able to broadly follow the instructions in
the iOS guide.
For tvOS, watchOS, and visionOS, you should be able to broadly follow the instructions
in the iOS guide. The testbed projects generated on iOS and visionOS may be used as
rough references as well.

### Using Objective C

Expand Down