{"id":13907957,"url":"https://github.com/beeware/Python-Apple-support","last_synced_at":"2025-07-18T06:31:57.695Z","repository":{"id":39757788,"uuid":"62371629","full_name":"beeware/Python-Apple-support","owner":"beeware","description":"A meta-package for building a version of Python that can be embedded into a macOS, iOS, tvOS or watchOS project.","archived":false,"fork":false,"pushed_at":"2024-10-28T02:25:19.000Z","size":6896,"stargazers_count":1122,"open_issues_count":3,"forks_count":164,"subscribers_count":37,"default_branch":"main","last_synced_at":"2024-10-28T04:44:59.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beeware.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["freakboy3742"],"custom":["http://beeware.org/bee/join"]}},"created_at":"2016-07-01T06:57:19.000Z","updated_at":"2024-10-28T02:25:19.000Z","dependencies_parsed_at":"2023-10-04T10:36:59.033Z","dependency_job_id":"88994d48-4bc0-4735-9dbf-9153f226866c","html_url":"https://github.com/beeware/Python-Apple-support","commit_stats":{"total_commits":218,"total_committers":11,"mean_commits":"19.818181818181817","dds":0.1651376146788991,"last_synced_commit":"3ecdb5d8ab35fcbf3bda418b94a11763716defff"},"previous_names":[],"tags_count":106,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeware%2FPython-Apple-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeware%2FPython-Apple-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeware%2FPython-Apple-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeware%2FPython-Apple-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beeware","download_url":"https://codeload.github.com/beeware/Python-Apple-support/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226361621,"owners_count":17612930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T23:02:21.083Z","updated_at":"2025-07-18T06:31:57.681Z","avatar_url":"https://github.com/beeware.png","language":"Makefile","funding_links":["https://github.com/sponsors/freakboy3742","http://beeware.org/bee/join"],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"Python Apple Support\n====================\n\nThis is a meta-package for building a version of Python that can be embedded\ninto a macOS, iOS, tvOS, watchOS, or visionOS project.\n\n**This branch builds a packaged version of Python 3.14**.\nOther Python versions are available by cloning other branches of the main\nrepository:\n\n* `Python 3.9 \u003chttps://github.com/beeware/Python-Apple-support/tree/3.9\u003e`__\n* `Python 3.10 \u003chttps://github.com/beeware/Python-Apple-support/tree/3.10\u003e`__\n* `Python 3.11 \u003chttps://github.com/beeware/Python-Apple-support/tree/3.11\u003e`__\n* `Python 3.12 \u003chttps://github.com/beeware/Python-Apple-support/tree/3.12\u003e`__\n* `Python 3.13 \u003chttps://github.com/beeware/Python-Apple-support/tree/3.13\u003e`__\n\nIt works by downloading, patching, and building a fat binary of Python and\nselected pre-requisites, and packaging them as frameworks that can be\nincorporated into an Xcode project. The binary modules in the Python standard\nlibrary are distributed as binaries that can be dynamically loaded at runtime.\n\nThe macOS package is a re-bundling of the official macOS binary, modified so that\nit is relocatable, with the IDLE, Tkinter and turtle packages removed, and the\nApp Store compliance patch applied.\n\nThe iOS, tvOS, watchOS, and visionOS packages compiled by this project use the\nofficial `PEP 730 \u003chttps://peps.python.org/pep-0730/\u003e`__ code that is part of\nPython 3.13 to provide iOS support; the relevant patches have been backported\nto 3.9-3.12. Additional patches have been applied to add tvOS, watchOS, and\nvisionOS support.\n\nThe binaries support x86_64 and arm64 for macOS; arm64 for iOS and appleTV\ndevices; arm64_32 for watchOS devices; and arm64 for visionOS devices. It also\nsupports device simulators on both x86_64 and M1 hardware, except for visionOS,\nfor which x86_64 simulators are officially unsupported. This should enable the\ncode to run on:\n\n* macOS 11 (Big Sur) or later, on:\n    * MacBook (including MacBooks using Apple Silicon)\n    * iMac (including iMacs using Apple Silicon)\n    * Mac Mini (including Apple Silicon Mac minis)\n    * Mac Studio (all models)\n    * Mac Pro (all models)\n* iOS 13.0 or later, on:\n    * iPhone (6s or later)\n    * iPad (5th gen or later)\n    * iPad Air (all models)\n    * iPad Mini (2 or later)\n    * iPad Pro (all models)\n    * iPod Touch (7th gen or later)\n* tvOS 12.0 or later, on:\n    * Apple TV (4th gen or later)\n* watchOS 4.0 or later, on:\n    * Apple Watch (4th gen or later)\n* visionOS 2.0 or later, on:\n    * Apple Vision Pro\n\nQuickstart\n----------\n\nThe easist way to use these packages is by creating a project with `Briefcase\n\u003chttps://github.com/beeware/briefcase\u003e`__. Briefcase will download pre-compiled\nversions of these support packages, and add them to an Xcode project (or\npre-build stub application, in the case of macOS).\n\nPre-built versions of the frameworks can be downloaded from the `Github releases page\n\u003chttps://github.com/beeware/Python-Apple-support/releases\u003e`__ and added to your project.\n\nAlternatively, to build the frameworks on your own, download/clone this\nrepository, and then in the root directory, and run:\n\n* ``make`` (or ``make all``) to build everything.\n* ``make macOS`` to build everything for macOS.\n* ``make iOS`` to build everything for iOS.\n* ``make tvOS`` to build everything for tvOS.\n* ``make watchOS`` to build everything for watchOS.\n* ``make visionOS`` to build everything for visionOS.\n\nThis should:\n\n1. Download the original source packages\n2. Patch them as required for compatibility with the selected OS\n3. Build the packages as Xcode-compatible XCFrameworks.\n\nThe resulting support packages will be packaged as ``.tar.gz`` files\nin the ``dist`` folder.\n\nEach support package contains:\n\n* ``VERSIONS``, a text file describing the specific versions of code used to build the\n  support package;\n* ``Python.xcframework``, a multi-architecture build of the Python runtime library.\n\nOn iOS/tvOS/watchOS/visionOS, the ``Python.xcframework`` contains a\nslice for each supported ABI (device and simulator). The folder containing the\nslice can also be used as a ``PYTHONHOME``, as it contains a ``bin``, ``include``\nand ``lib`` directory.\n\nThe ``bin`` folder does not contain Python executables (as they can't be\ninvoked). However, it *does* contain shell aliases for the compilers that are\nneeded to build packages. This is required because Xcode uses the ``xcrun``\nalias to dynamically generate the name of binaries, but a lot of C tooling\nexpects that ``CC`` will not contain spaces.\n\nEach slice of an iOS/tvOS/watchOS/visionOS XCframework also contains a\n``platform-config`` folder with a subfolder for each supported architecture in\nthat slice. These subfolders can be used to make a macOS Python environment\nbehave as if it were on an iOS/tvOS/watchOS/visionOS device. This works in one\nof two ways:\n\n1. **A sitecustomize.py script**. If the ``platform-config`` subfolder is on\n   your ``PYTHONPATH`` when a Python interpreter is started, a site\n   customization will be applied that patches methods in ``sys``, ``sysconfig``\n   and ``platform`` that are used to identify the system.\n\n2. **A make_cross_venv.py script**. If you call ``make_cross_venv.py``,\n   providing the location of a virtual environment, the script will add some\n   files to the ``site-packages`` folder of that environment that will\n   automatically apply the same set of patches as the ``sitecustomize.py``\n   script whenever the environment is activated, without any need to modify\n   ``PYTHONPATH``. If you use ``build`` to create an isolated PEP 517\n   environment to build a wheel, these patches will also be applied to the\n   isolated build environment that is created.\n\niOS and visionOS distributions also contain a copy of the iOS or visionOS\n``testbed`` project - an Xcode project that can be used to run test suites of\nPython code. See the `CPython documentation on testing packages\n\u003chttps://docs.python.org/3/using/ios.html#testing-a-python-package\u003e`__ for\ndetails on how to use this testbed.\n\nFor a detailed instructions on using the support package in your own project,\nsee the `usage guide \u003c./USAGE.md\u003e`__\n\nBuilding binary wheels\n----------------------\n\nThis project packages the Python standard library, but does not address building\nbinary wheels. Binary wheels for macOS can be obtained from PyPI. `Mobile Forge\n\u003chttps://github.com/beeware/mobile-forge\u003e`__ is a project that provides the\ntooling to build build binary wheels for iOS (and potentially for tvOS, watchOS,\nand visionOS, although that hasn't been tested).\n\nHistorical support\n------------------\n\nThe following versions were supported in the past, but are no longer\nmaintained:\n\n* `Python 2.7 \u003chttps://github.com/beeware/Python-Apple-support/tree/2.7\u003e`__ (EOL January 2020)\n* `Python 3.4 \u003chttps://github.com/beeware/Python-Apple-support/tree/3.4\u003e`__ (EOL March 2019)\n* `Python 3.5 \u003chttps://github.com/beeware/Python-Apple-support/tree/3.5\u003e`__ (EOL February 2021)\n* `Python 3.6 \u003chttps://github.com/beeware/Python-Apple-support/tree/3.6\u003e`__ (EOL December 2021)\n* `Python 3.7 \u003chttps://github.com/beeware/Python-Apple-support/tree/3.7\u003e`__ (EOL September 2022)\n* `Python 3.8 \u003chttps://github.com/beeware/Python-Apple-support/tree/3.8\u003e`__ (EOL October 2024)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeeware%2FPython-Apple-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeeware%2FPython-Apple-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeeware%2FPython-Apple-support/lists"}