Skip to content

Commit a150e6f

Browse files
committed
Merge recent changes from main.
2 parents 0c0096f + 28af999 commit a150e6f

File tree

9 files changed

+352
-175
lines changed

9 files changed

+352
-175
lines changed

.github/workflows/ci.yaml

Lines changed: 86 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: CI
22
on:
33
pull_request:
4+
push:
5+
branches:
6+
- main
7+
- 3.*
48
workflow_call:
59
inputs:
610
build-number:
@@ -89,7 +93,7 @@ jobs:
8993
strategy:
9094
fail-fast: false
9195
matrix:
92-
target: ['macOS', 'iOS', 'tvOS', 'watchOS']
96+
platform: ['macOS', 'iOS', 'tvOS', 'watchOS']
9397

9498
steps:
9599
- uses: actions/[email protected]
@@ -104,29 +108,29 @@ jobs:
104108
# It's an edge case, but when a new alpha is released, we need to use it ASAP.
105109
check-latest: true
106110

107-
- name: Build ${{ matrix.target }}
111+
- name: Build ${{ matrix.platform }}
108112
run: |
109-
# Do the build for the requested target.
110-
make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
113+
# Do the build for the requested platform.
114+
make ${{ matrix.platform }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
111115
112116
- name: Upload build artefacts
113117
uses: actions/[email protected]
114118
with:
115-
name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
116-
path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
119+
name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
120+
path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
117121

118122
briefcase-testbed:
119-
name: Briefcase testbed (${{ matrix.target }})
123+
name: Briefcase testbed (${{ matrix.platform }})
120124
runs-on: macOS-latest
121125
needs: [ config, build ]
122126
strategy:
123127
fail-fast: false
124128
matrix:
125-
target: ["macOS", "iOS"]
129+
platform: ["macOS", "iOS"]
126130
include:
127131
- briefcase-run-args:
128132

129-
- target: iOS
133+
- platform: iOS
130134
briefcase-run-args: ' -d "iPhone SE (3rd generation)"'
131135

132136
steps:
@@ -135,12 +139,12 @@ jobs:
135139
- name: Get build artifact
136140
uses: actions/[email protected]
137141
with:
138-
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
142+
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
139143
path: dist
140144
merge-multiple: true
141145

142146
- name: Set up Python
143-
uses: actions/[email protected].0
147+
uses: actions/[email protected].2
144148
with:
145149
# Appending -dev ensures that we can always build the dev release.
146150
# It's a no-op for versions that have been published.
@@ -162,24 +166,24 @@ jobs:
162166
- name: Run support testbed check
163167
timeout-minutes: 10
164168
working-directory: Python-support-testbed
165-
run: briefcase run ${{ matrix.target }} Xcode --test ${{ matrix.briefcase-run-args }} -C support_package=\'../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz\'
169+
run: briefcase run ${{ matrix.platform }} Xcode --test ${{ matrix.briefcase-run-args }} -C support_package=\'../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz\'
166170

167171
cpython-testbed:
168-
name: CPython testbed (${{ matrix.target }})
172+
name: CPython testbed (${{ matrix.platform }})
169173
runs-on: macOS-latest
170174
needs: [ config, build ]
171175
strategy:
172176
fail-fast: false
173177
matrix:
174-
target: ["iOS"]
178+
platform: ["iOS"]
175179

176180
steps:
177181
- uses: actions/[email protected]
178182

179183
- name: Get build artifact
180184
uses: actions/[email protected]
181185
with:
182-
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
186+
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
183187
path: dist
184188
merge-multiple: true
185189

@@ -195,13 +199,13 @@ jobs:
195199

196200
- name: Unpack support package
197201
run: |
198-
mkdir support
199-
cd support
200-
tar zxvf ../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
202+
mkdir -p support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
203+
cd support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
204+
tar zxvf ../../../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
201205
202206
- name: Run CPython testbed
203207
timeout-minutes: 10
204-
working-directory: support
208+
working-directory: support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
205209
run: |
206210
# Run a representative subset of CPython core tests:
207211
# - test_builtin as a test of core language tools
@@ -210,3 +214,66 @@ jobs:
210214
# - test_bz2 as a simple test of third party libraries
211215
# - test_ctypes as a test of FFI
212216
python -m testbed run -- test --single-process --rerun -W test_builtin test_grammar test_os test_bz2 test_ctypes
217+
218+
crossenv-test:
219+
name: Cross-platform env test (${{ matrix.platform }})
220+
runs-on: macOS-latest
221+
needs: [ config, build ]
222+
strategy:
223+
fail-fast: false
224+
matrix:
225+
include:
226+
- platform: iOS
227+
slice: ios-arm64_x86_64-simulator
228+
multiarch: arm64-iphonesimulator
229+
- platform: iOS
230+
slice: ios-arm64_x86_64-simulator
231+
multiarch: x86_64-iphonesimulator
232+
- platform: iOS
233+
slice: ios-arm64
234+
multiarch: arm64-iphoneos
235+
236+
steps:
237+
- uses: actions/[email protected]
238+
239+
- name: Get build artifact
240+
uses: actions/[email protected]
241+
with:
242+
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
243+
path: dist
244+
merge-multiple: true
245+
246+
- name: Set up Python
247+
uses: actions/[email protected]
248+
with:
249+
# Appending -dev ensures that we can always build the dev release.
250+
# It's a no-op for versions that have been published.
251+
python-version: ${{ needs.config.outputs.PYTHON_VER }}-dev
252+
# Ensure that we *always* use the latest build, not a cached version.
253+
# It's an edge case, but when a new alpha is released, we need to use it ASAP.
254+
check-latest: true
255+
256+
- name: Unpack support package
257+
run: |
258+
mkdir -p support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
259+
cd support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
260+
tar zxvf ../../../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
261+
262+
- name: Run cross-platform environment test
263+
env:
264+
PYTHON_CROSS_PLATFORM: ${{ matrix.platform }}
265+
PYTHON_CROSS_SLICE: ${{ matrix.slice }}
266+
PYTHON_CROSS_MULTIARCH: ${{ matrix.multiarch }}
267+
run: |
268+
# Create and activate a native virtual environment
269+
python${{ needs.config.outputs.PYTHON_VER }} -m venv cross-venv
270+
source cross-venv/bin/activate
271+
272+
# Install pytest
273+
python -m pip install pytest
274+
275+
# Convert venv into cross-venv
276+
python support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}/Python.xcframework/${{ matrix.slice }}/platform-config/${{ matrix.multiarch }}/make_cross_venv.py cross-venv
277+
278+
# Run the test suite
279+
python -m pytest tests

.github/workflows/publish.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ jobs:
4848
# watchOS build
4949
curl -o watchOS-artefact.tar.gz -L https://github.com/beeware/Python-Apple-support/releases/download/${{ steps.build-vars.outputs.TAG }}/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-watchOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
5050
aws s3 cp watchOS-artefact.tar.gz s3://briefcase-support/python/${{ steps.build-vars.outputs.PYTHON_VER }}/watchOS/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-watchOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
51+
# visionOS build
52+
curl -o visionOS-artefact.tar.gz -L https://github.com/beeware/Python-Apple-support/releases/download/${{ steps.build-vars.outputs.TAG }}/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-visionOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz
53+
aws s3 cp visionOS-artefact.tar.gz s3://briefcase-support/python/${{ steps.build-vars.outputs.PYTHON_VER }}/visionOS/Python-${{ steps.build-vars.outputs.PYTHON_VER }}-visionOS-support.${{ steps.build-vars.outputs.BUILD_NUMBER }}.tar.gz

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
merge-multiple: true
4848

4949
- name: Create Release
50-
uses: ncipollo/release-action@v1.16.0
50+
uses: ncipollo/release-action@v1.18.0
5151
with:
5252
name: ${{ needs.ci.outputs.PYTHON_VER }}-${{ needs.config.outputs.BUILD_NUMBER }}
5353
tag: ${{ needs.ci.outputs.PYTHON_VER }}-${{ needs.config.outputs.BUILD_NUMBER }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ tests/testbed/iOS
1515
*.log
1616
*.gz
1717
*.DS_Store
18+
cross-venv/
19+
temp

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# - iOS - build everything for iOS
66
# - tvOS - build everything for tvOS
77
# - watchOS - build everything for watchOS
8-
# - visionOS - build everything for visionOS
98

109
# Current directory
1110
PROJECT_DIR=$(shell pwd)
@@ -34,7 +33,7 @@ OPENSSL_VERSION=3.0.16-2
3433
XZ_VERSION=5.6.4-2
3534

3635
# Supported OS
37-
OS_LIST=macOS iOS tvOS watchOS visionOS
36+
OS_LIST=macOS iOS tvOS watchOS
3837

3938
CURL_FLAGS=--disable --fail --location --create-dirs --progress-bar
4039

@@ -89,7 +88,7 @@ update-patch:
8988
# comparing between the current state of the 3.X branch against the v3.X.Y
9089
# tag associated with the release being built. This allows you to
9190
# maintain a branch that contains custom patches against the default Python.
92-
# The patch archived in this respository is based on github.com/freakboy3742/cpython
91+
# The patch archived in this repository is based on github.com/freakboy3742/cpython
9392
# Requires patchutils (installable via `brew install patchutils`); this
9493
# also means we need to re-introduce homebrew to the path for the filterdiff
9594
# call
@@ -333,7 +332,7 @@ $$(PYTHON_LIB-$(target)): $$(PYTHON_SRCDIR-$(target))/python.exe
333332

334333

335334
$$(PYTHON_PLATFORM_SITECUSTOMIZE-$(target)):
336-
@echo ">>> Create cross-plaform config for $(target)"
335+
@echo ">>> Create cross-platform config for $(target)"
337336
mkdir -p $$(PYTHON_PLATFORM_CONFIG-$(target))
338337
# Create the cross-platform site definition
339338
echo "import _cross_$$(ARCH-$(target))_$$(SDK-$(target)); import _cross_venv;" \

0 commit comments

Comments
 (0)