Skip to content

Commit b2f091f

Browse files
committed
[3.14] pythongh-146444: Move the Apple folder to the Platforms directory (python#146497)
Migrate the Apple/iOS XCframework build tools to the Platforms directory.
1 parent c63aec6 commit b2f091f

47 files changed

Lines changed: 50 additions & 46 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ jobs:
401401
sudo xcode-select --switch /Applications/Xcode_15.4.app
402402
403403
- name: Build and test
404-
run: python3 Apple ci iOS --fast-ci --simulator 'iPhone SE (3rd generation),OS=17.5'
404+
run: python3 Platforms/Apple ci iOS --fast-ci --simulator 'iPhone SE (3rd generation),OS=17.5'
405405

406406
build-emscripten:
407407
name: 'Emscripten'

‎.pre-commit-config.yaml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ repos:
33
rev: a27a2e47c7751b639d2b5badf0ef6ff11fee893f # frozen: v0.15.4
44
hooks:
55
- id: ruff-check
6-
name: Run Ruff (lint) on Apple/
7-
args: [--exit-non-zero-on-fix, --config=Apple/.ruff.toml]
8-
files: ^Apple/
6+
name: Run Ruff (lint) on Platforms/Apple/
7+
args: [--exit-non-zero-on-fix, --config=Platforms/Apple/.ruff.toml]
8+
files: ^Platforms/Apple/
99
- id: ruff-check
1010
name: Run Ruff (lint) on Doc/
1111
args: [--exit-non-zero-on-fix]
@@ -35,9 +35,9 @@ repos:
3535
args: [--exit-non-zero-on-fix, --config=Tools/wasm/.ruff.toml]
3636
files: ^Tools/wasm/
3737
- id: ruff-format
38-
name: Run Ruff (format) on Apple/
39-
args: [--exit-non-zero-on-fix, --config=Apple/.ruff.toml]
40-
files: ^Apple
38+
name: Run Ruff (format) on Platforms/Apple/
39+
args: [--exit-non-zero-on-fix, --config=Platforms/Apple/.ruff.toml]
40+
files: ^Platforms/Apple/
4141
- id: ruff-format
4242
name: Run Ruff (format) on Doc/
4343
args: [--exit-non-zero-on-fix]

‎Makefile.pre.in‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,7 +2321,7 @@ testios:
23212321
fi
23222322

23232323
# Clone the testbed project into the XCFOLDER
2324-
$(PYTHON_FOR_BUILD) $(srcdir)/Apple/testbed clone --framework $(PYTHONFRAMEWORKPREFIX) "$(XCFOLDER)"
2324+
$(PYTHON_FOR_BUILD) $(srcdir)/Platforms/Apple/testbed clone --framework $(PYTHONFRAMEWORKPREFIX) "$(XCFOLDER)"
23252325

23262326
# Run the testbed project
23272327
$(PYTHON_FOR_BUILD) "$(XCFOLDER)" run --verbose -- test -uall --single-process --rerun -W
@@ -3230,10 +3230,10 @@ clean-retain-profile: pycremoval
32303230
-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
32313231
-rm -f Include/pydtrace_probes.h
32323232
-rm -f profile-gen-stamp
3233-
-rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/bin
3234-
-rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/lib
3235-
-rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/include
3236-
-rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/Python.framework
3233+
-rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/bin
3234+
-rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/lib
3235+
-rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/include
3236+
-rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/Python.framework
32373237

32383238
.PHONY: profile-removal
32393239
profile-removal:
@@ -3267,7 +3267,7 @@ clobber: clean
32673267
config.cache config.log pyconfig.h Modules/config.c
32683268
-rm -rf build platform
32693269
-rm -rf $(PYTHONFRAMEWORKDIR)
3270-
-rm -rf Apple/iOS/Frameworks
3270+
-rm -rf Platforms/Apple/iOS/Frameworks
32713271
-rm -rf iOSTestbed.*
32723272
-rm -f python-config.py python-config
32733273
-rm -rf cross-build
Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
extend = "../.ruff.toml" # Inherit the project-wide settings
1+
extend = "../../.ruff.toml" # Inherit the project-wide settings
22

33
[format]
44
preview = true
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# The simplest entry point is:
1212
#
13-
# $ python Apple ci iOS
13+
# $ python Platforms/Apple ci iOS
1414
#
1515
# which will:
1616
# * Clean any pre-existing build artefacts
@@ -57,7 +57,7 @@
5757
ArgsT = Sequence[str | Path]
5858

5959
SCRIPT_NAME = Path(__file__).name
60-
PYTHON_DIR = Path(__file__).resolve().parent.parent
60+
PYTHON_DIR = Path(__file__).resolve().parent.parent.parent
6161

6262
CROSS_BUILD_DIR = PYTHON_DIR / "cross-build"
6363

@@ -140,7 +140,7 @@ def apple_env(host: str) -> EnvironmentT:
140140
"""Construct an Apple development environment for the given host."""
141141
env = {
142142
"PATH": ":".join([
143-
str(PYTHON_DIR / "Apple/iOS/Resources/bin"),
143+
str(PYTHON_DIR / "Platforms/Apple/iOS/Resources/bin"),
144144
str(subdir(host) / "prefix"),
145145
"/usr/bin",
146146
"/bin",
@@ -440,7 +440,10 @@ def framework_path(host_triple: str, multiarch: str) -> Path:
440440
:param host_triple: The host triple (e.g., arm64-apple-ios-simulator)
441441
:param multiarch: The multiarch identifier (e.g., arm64-simulator)
442442
"""
443-
return CROSS_BUILD_DIR / f"{host_triple}/Apple/iOS/Frameworks/{multiarch}"
443+
return (
444+
CROSS_BUILD_DIR
445+
/ f"{host_triple}/Platforms/Apple/iOS/Frameworks/{multiarch}"
446+
)
444447

445448

446449
def package_version(prefix_path: Path) -> str:
@@ -624,7 +627,7 @@ def create_xcframework(platform: str) -> str:
624627

625628
# Copy in the cross-architecture pyconfig.h
626629
shutil.copy(
627-
PYTHON_DIR / f"Apple/{platform}/Resources/pyconfig.h",
630+
PYTHON_DIR / f"Platforms/Apple/{platform}/Resources/pyconfig.h",
628631
slice_framework / "Headers/pyconfig.h",
629632
)
630633

@@ -661,7 +664,7 @@ def create_xcframework(platform: str) -> str:
661664
host_path = (
662665
CROSS_BUILD_DIR
663666
/ host_triple
664-
/ "Apple/iOS/Frameworks"
667+
/ "Platforms/Apple/iOS/Frameworks"
665668
/ multiarch
666669
)
667670
host_framework = host_path / "Python.framework"
@@ -691,7 +694,7 @@ def create_xcframework(platform: str) -> str:
691694

692695
print(" - build tools")
693696
shutil.copytree(
694-
PYTHON_DIR / "Apple/testbed/Python.xcframework/build",
697+
PYTHON_DIR / "Platforms/Apple/testbed/Python.xcframework/build",
695698
package_path / "Python.xcframework/build",
696699
)
697700

@@ -711,7 +714,7 @@ def package(context: argparse.Namespace) -> None:
711714
print()
712715
run([
713716
sys.executable,
714-
"Apple/testbed",
717+
"Platforms/Apple/testbed",
715718
"clone",
716719
"--platform",
717720
context.platform,
@@ -806,13 +809,13 @@ def test(context: argparse.Namespace, host: str | None = None) -> None: # noqa:
806809
framework_path = (
807810
CROSS_BUILD_DIR
808811
/ host
809-
/ f"Apple/{context.platform}"
812+
/ f"Platforms/Apple/{context.platform}"
810813
/ f"Frameworks/{apple_multiarch(host)}"
811814
)
812815

813816
run([
814817
sys.executable,
815-
"Apple/testbed",
818+
"Platforms/Apple/testbed",
816819
"clone",
817820
"--platform",
818821
context.platform,
Lines changed: 15 additions & 15 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)