Skip to content

Commit 564a388

Browse files
authored
Update patch to Python 3.12.12 (#339)
Updates the patch to CPython 3.12.12. Also applies the changes to remove duplication of the standard library, use per-architecture lib directores in each slice, add a symlink for libpython, and a utils folder.
1 parent a8a256f commit 564a388

File tree

9 files changed

+12576
-9782
lines changed

9 files changed

+12576
-9782
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ updates:
44
- package-ecosystem: "github-actions"
55
directory: "/"
66
schedule:
7-
# Check for updates on Sunday, 8PM UTC
8-
interval: "weekly"
9-
day: "sunday"
10-
time: "20:00"
7+
# Check for updates on the first Sunday of every month, 8PM UTC
8+
interval: "cron"
9+
cronjob: "0 20 * * sun#1"

.github/workflows/ci.yaml

Lines changed: 188 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
XZ_VERSION: ${{ steps.extract.outputs.XZ_VERSION }}
5757

5858
steps:
59-
- uses: actions/checkout@v4.1.7
59+
- uses: actions/checkout@v6
6060

6161
- name: Extract config variables
6262
id: extract
@@ -84,28 +84,27 @@ jobs:
8484
echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT}
8585
8686
build:
87-
runs-on: macOS-latest
87+
runs-on: macOS-15
8888
needs: [ config ]
8989
strategy:
9090
fail-fast: false
9191
matrix:
92-
target: ['macOS', 'iOS', 'tvOS', 'watchOS']
93-
include:
94-
- briefcase-run-args:
95-
- run-tests: false
96-
97-
- target: macOS
98-
run-tests: true
99-
100-
- target: iOS
101-
briefcase-run-args: ' -d "iPhone SE (3rd generation)"'
102-
run-tests: true
92+
platform: ['macOS', 'iOS', 'tvOS', 'watchOS']
10393

10494
steps:
105-
- uses: actions/checkout@v4.1.7
95+
- uses: actions/checkout@v6
96+
97+
- name: Set up Xcode
98+
# GitHub recommends explicitly selecting the desired Xcode version:
99+
# https://github.com/actions/runner-images/issues/12541#issuecomment-3083850140
100+
# This became a necessity as a result of
101+
# https://github.com/actions/runner-images/issues/12541 and
102+
# https://github.com/actions/runner-images/issues/12751.
103+
run: |
104+
sudo xcode-select --switch /Applications/Xcode_16.4.app
106105
107106
- name: Set up Python
108-
uses: actions/setup-python@v5.4.0
107+
uses: actions/setup-python@v6.1.0
109108
with:
110109
# Appending -dev ensures that we can always build the dev release.
111110
# It's a no-op for versions that have been published.
@@ -114,31 +113,193 @@ jobs:
114113
# It's an edge case, but when a new alpha is released, we need to use it ASAP.
115114
check-latest: true
116115

117-
- name: Build ${{ matrix.target }}
116+
- name: Build ${{ matrix.platform }}
118117
run: |
119-
# Do the build for the requested target.
120-
make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
118+
# Do the build for the requested platform.
119+
make ${{ matrix.platform }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
121120
122121
- name: Upload build artefacts
123-
uses: actions/upload-artifact@v4.6.1
122+
uses: actions/upload-artifact@v6.0.0
123+
with:
124+
name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
125+
path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
126+
127+
briefcase-testbed:
128+
name: Briefcase testbed (${{ matrix.platform }})
129+
runs-on: macOS-15
130+
needs: [ config, build ]
131+
strategy:
132+
fail-fast: false
133+
matrix:
134+
platform: ["macOS", "iOS"]
135+
include:
136+
- briefcase-run-args:
137+
138+
- platform: iOS
139+
briefcase-run-args: ' -d "iPhone 16e::iOS 18.5"'
140+
141+
steps:
142+
- uses: actions/checkout@v6
143+
144+
- name: Set up Xcode
145+
# GitHub recommends explicitly selecting the desired Xcode version:
146+
# https://github.com/actions/runner-images/issues/12541#issuecomment-3083850140
147+
# This became a necessity as a result of
148+
# https://github.com/actions/runner-images/issues/12541 and
149+
# https://github.com/actions/runner-images/issues/12751.
150+
run: |
151+
sudo xcode-select --switch /Applications/Xcode_16.4.app
152+
153+
- name: Get build artifact
154+
uses: actions/download-artifact@v7.0.0
124155
with:
125-
name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
126-
path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
156+
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
157+
path: dist
158+
merge-multiple: true
127159

128-
- uses: actions/checkout@v4.1.7
129-
if: matrix.run-tests
160+
- name: Set up Python
161+
uses: actions/setup-python@v6.1.0
162+
with:
163+
# Appending -dev ensures that we can always build the dev release.
164+
# It's a no-op for versions that have been published.
165+
python-version: ${{ needs.config.outputs.PYTHON_VER }}-dev
166+
# Ensure that we *always* use the latest build, not a cached version.
167+
# It's an edge case, but when a new alpha is released, we need to use it ASAP.
168+
check-latest: true
169+
170+
- uses: actions/checkout@v6
130171
with:
131172
repository: beeware/Python-support-testbed
132173
path: Python-support-testbed
133174

134175
- name: Install dependencies
135-
if: matrix.run-tests
136176
run: |
137177
# Use the development version of Briefcase
138178
python -m pip install git+https://github.com/beeware/briefcase.git
139179
140180
- name: Run support testbed check
141-
if: matrix.run-tests
142-
timeout-minutes: 10
181+
timeout-minutes: 15
143182
working-directory: Python-support-testbed
144-
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\'
183+
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\'
184+
185+
cpython-testbed:
186+
name: CPython testbed (${{ matrix.platform }})
187+
runs-on: macOS-15
188+
needs: [ config, build ]
189+
strategy:
190+
fail-fast: false
191+
matrix:
192+
platform: ["iOS", "tvOS"]
193+
include:
194+
- platform: "iOS"
195+
testbed-args: '--simulator "iPhone 16e,arch=arm64,OS=18.5"'
196+
197+
steps:
198+
- uses: actions/checkout@v6
199+
200+
- name: Get build artifact
201+
uses: actions/download-artifact@v7.0.0
202+
with:
203+
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
204+
path: dist
205+
merge-multiple: true
206+
207+
- name: Set up Xcode
208+
# GitHub recommends explicitly selecting the desired Xcode version:
209+
# https://github.com/actions/runner-images/issues/12541#issuecomment-3083850140
210+
# This became a necessity as a result of
211+
# https://github.com/actions/runner-images/issues/12541 and
212+
# https://github.com/actions/runner-images/issues/12751.
213+
run: |
214+
sudo xcode-select --switch /Applications/Xcode_16.4.app
215+
216+
- name: Set up Python
217+
uses: actions/setup-python@v6.1.0
218+
with:
219+
# Appending -dev ensures that we can always build the dev release.
220+
# It's a no-op for versions that have been published.
221+
python-version: ${{ needs.config.outputs.PYTHON_VER }}-dev
222+
# Ensure that we *always* use the latest build, not a cached version.
223+
# It's an edge case, but when a new alpha is released, we need to use it ASAP.
224+
check-latest: true
225+
226+
- name: Unpack support package
227+
run: |
228+
mkdir -p support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
229+
cd support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
230+
tar zxvf ../../../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
231+
232+
- name: Run CPython testbed
233+
timeout-minutes: 15
234+
working-directory: support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
235+
run: |
236+
# Run a representative subset of CPython core tests:
237+
# - test_builtin as a test of core language tools
238+
# - test_grammar as a test of core language features
239+
# - test_os as a test of system library calls
240+
# - test_bz2 as a simple test of third party libraries
241+
# - test_ctypes as a test of FFI
242+
python -m testbed run --verbose ${{ matrix.testbed-args }} -- test --single-process --rerun -W test_builtin test_grammar test_os test_bz2 test_ctypes
243+
244+
crossenv-test:
245+
name: Cross-platform env test (${{ matrix.multiarch }})
246+
runs-on: macOS-latest
247+
needs: [ config, build ]
248+
strategy:
249+
fail-fast: false
250+
matrix:
251+
include:
252+
- platform: iOS
253+
slice: ios-arm64_x86_64-simulator
254+
multiarch: arm64-iphonesimulator
255+
- platform: iOS
256+
slice: ios-arm64_x86_64-simulator
257+
multiarch: x86_64-iphonesimulator
258+
- platform: iOS
259+
slice: ios-arm64
260+
multiarch: arm64-iphoneos
261+
262+
steps:
263+
- uses: actions/checkout@v6
264+
265+
- name: Get build artifact
266+
uses: actions/download-artifact@v7.0.0
267+
with:
268+
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
269+
path: dist
270+
merge-multiple: true
271+
272+
- name: Set up Python
273+
uses: actions/setup-python@v6.1.0
274+
with:
275+
# Appending -dev ensures that we can always build the dev release.
276+
# It's a no-op for versions that have been published.
277+
python-version: ${{ needs.config.outputs.PYTHON_VER }}-dev
278+
# Ensure that we *always* use the latest build, not a cached version.
279+
# It's an edge case, but when a new alpha is released, we need to use it ASAP.
280+
check-latest: true
281+
282+
- name: Unpack support package
283+
run: |
284+
mkdir -p support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
285+
cd support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
286+
tar zxvf ../../../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
287+
288+
- name: Run cross-platform environment test
289+
env:
290+
PYTHON_CROSS_PLATFORM: ${{ matrix.platform }}
291+
PYTHON_CROSS_SLICE: ${{ matrix.slice }}
292+
PYTHON_CROSS_MULTIARCH: ${{ matrix.multiarch }}
293+
run: |
294+
# Create and activate a native virtual environment
295+
python${{ needs.config.outputs.PYTHON_VER }} -m venv cross-venv
296+
source cross-venv/bin/activate
297+
298+
# Install pytest
299+
python -m pip install pytest
300+
301+
# Convert venv into cross-venv
302+
python support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}/Python.xcframework/${{ matrix.slice }}/platform-config/${{ matrix.multiarch }}/make_cross_venv.py cross-venv
303+
304+
# Run the test suite
305+
python -m pytest tests

.github/workflows/publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
publish:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v6
1212

1313
- name: Set up Python environment
14-
uses: actions/setup-python@v5.4.0
14+
uses: actions/setup-python@v6.1.0
1515
with:
1616
python-version: "3.X"
1717

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
needs: [ config, ci ]
4141
steps:
4242
- name: Get build artifacts
43-
uses: actions/download-artifact@v4.1.9
43+
uses: actions/download-artifact@v7.0.0
4444
with:
4545
pattern: Python-*
4646
path: dist
4747
merge-multiple: true
4848

4949
- name: Create Release
50-
uses: ncipollo/release-action@v1.16.0
50+
uses: ncipollo/release-action@v1.20.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 }}

0 commit comments

Comments
 (0)