Skip to content

Commit 36e4ffc

Browse files
authored
gh-146444: Move the Apple folder to the Platforms directory (#146497)
Migrate the Apple/iOS XCframework build tools to the Platforms directory.
1 parent 5684b3a commit 36e4ffc

Some content is hidden

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

47 files changed

+50
-46
lines changed

.github/workflows/build.yml

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

374374
build-emscripten:
375375
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]
@@ -39,9 +39,9 @@ repos:
3939
args: [--exit-non-zero-on-fix, --config=Tools/wasm/.ruff.toml]
4040
files: ^Tools/wasm/
4141
- id: ruff-format
42-
name: Run Ruff (format) on Apple/
43-
args: [--exit-non-zero-on-fix, --config=Apple/.ruff.toml]
44-
files: ^Apple
42+
name: Run Ruff (format) on Platforms/Apple/
43+
args: [--exit-non-zero-on-fix, --config=Platforms/Apple/.ruff.toml]
44+
files: ^Platforms/Apple/
4545
- id: ruff-format
4646
name: Run Ruff (format) on Doc/
4747
args: [--exit-non-zero-on-fix]

Makefile.pre.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,7 @@ testios:
23582358
fi
23592359

23602360
# Clone the testbed project into the XCFOLDER
2361-
$(PYTHON_FOR_BUILD) $(srcdir)/Apple/testbed clone --framework $(PYTHONFRAMEWORKPREFIX) "$(XCFOLDER)"
2361+
$(PYTHON_FOR_BUILD) $(srcdir)/Platforms/Apple/testbed clone --framework $(PYTHONFRAMEWORKPREFIX) "$(XCFOLDER)"
23622362

23632363
# Run the testbed project
23642364
$(PYTHON_FOR_BUILD) "$(XCFOLDER)" run --verbose -- test -uall --single-process --rerun -W --pythoninfo
@@ -3286,10 +3286,10 @@ clean-retain-profile: pycremoval
32863286
-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
32873287
-rm -f Include/pydtrace_probes.h
32883288
-rm -f profile-gen-stamp
3289-
-rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/bin
3290-
-rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/lib
3291-
-rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/include
3292-
-rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/Python.framework
3289+
-rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/bin
3290+
-rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/lib
3291+
-rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/include
3292+
-rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/Python.framework
32933293

32943294
.PHONY: profile-removal
32953295
profile-removal:
@@ -3323,7 +3323,7 @@ clobber: clean
33233323
config.cache config.log pyconfig.h Modules/config.c
33243324
-rm -rf build platform
33253325
-rm -rf $(PYTHONFRAMEWORKDIR)
3326-
-rm -rf Apple/iOS/Frameworks
3326+
-rm -rf Platforms/Apple/iOS/Frameworks
33273327
-rm -rf iOSTestbed.*
33283328
-rm -f python-config.py python-config
33293329
-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)