* feat: add CPython 3.15 support for iOS Assisted-by: OpenCode:Kimi-K2.6 Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * fix: copy in iOS support files Assisted-by: Copilot:claude-sonnet-4.6 Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * fix: skip directories when copying iOS support files When copying multiarch-specific support files (e.g. _cross_arm64_iphoneos.py), the code was trying to copy all items in the directory including __pycache__ directories. The shutil.copy() function only works with files, not directories, which caused an IsADirectoryError. This fix adds a check to only copy files, skipping any directories like __pycache__ that may have been created by Python imports. Assisted-by: Copilot:claude-haiku-4.5 * fix: - in dir fine for now Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * fix: apply review suggestions Assisted-by: Copilot:claude-sonnet-4.6 Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * fix: only do this on 3.15+ Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * Ensure target Python directory exists before build Add assertion to check if target Python directory exists. * fix(ios): use stdlib dir directly instead of copying to platform-config Remove the _inject_support_files workaround for python.org 3.15+ distributions. Instead of copying sysconfig files from the stdlib into a synthetic platform-config/ directory, pass the stdlib directory directly to make_cross_venv.py. make_cross_venv.py is updated to derive the multiarch tag from the _sysconfigdata_ filename rather than assuming it comes from the directory name. Co-authored-by: Russell Keith-Magee <russell@keith-magee.com> Assisted-by: OpenCode:Kimi-K2.6 Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * Minor format cleanups on pre-commit skipped files. * Clarify path names in make_cross_venv script. --------- Signed-off-by: Henry Schreiner <henryfs@princeton.edu> Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
23 lines
715 B
Python
23 lines
715 B
Python
# A site customization that can be used to trick pip into installing packages
|
|
# cross-platform. If the folder containing this file is on your PYTHONPATH when
|
|
# you invoke python, the interpreter will behave as if it were running on
|
|
# arm64 iphoneos.
|
|
import sys
|
|
import os
|
|
|
|
# Apply the cross-platform patch
|
|
import _cross_arm64_iphoneos
|
|
import _cross_venv
|
|
|
|
|
|
# Call the next sitecustomize script if there is one
|
|
# (https://nedbatchelder.com/blog/201001/running_code_at_python_startup.html).
|
|
del sys.modules["sitecustomize"]
|
|
this_dir = os.path.dirname(__file__)
|
|
path_index = sys.path.index(this_dir)
|
|
del sys.path[path_index]
|
|
try:
|
|
import sitecustomize # noqa: F401
|
|
finally:
|
|
sys.path.insert(path_index, this_dir)
|