Skip to content

Commit db3b097

Browse files
committed
Bump to Python 3.14.0rc3.
1 parent 26982d8 commit db3b097

File tree

3 files changed

+6836
-2881
lines changed

3 files changed

+6836
-2881
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ on:
2929
XZ_VERSION:
3030
description: "The XZ version used for the build."
3131
value: ${{ jobs.config.outputs.XZ_VERSION }}
32+
ZSTD_VERSION:
33+
description: "The Zstandard version used for the build."
34+
value: ${{ jobs.config.outputs.ZSTD_VERSION }}
3235

3336
env:
3437
FORCE_COLOR: "1"
@@ -54,6 +57,7 @@ jobs:
5457
MPDECIMAL_VERSION: ${{ steps.extract.outputs.MPDECIMAL_VERSION }}
5558
OPENSSL_VERSION: ${{ steps.extract.outputs.OPENSSL_VERSION }}
5659
XZ_VERSION: ${{ steps.extract.outputs.XZ_VERSION }}
60+
ZSTD_VERSION: ${{ steps.extract.outputs.ZSTD_VERSION }}
5761

5862
steps:
5963
- uses: actions/checkout@v5
@@ -68,6 +72,7 @@ jobs:
6872
MPDECIMAL_VERSION=$(make config | grep "MPDECIMAL_VERSION=" | cut -d "=" -f 2)
6973
OPENSSL_VERSION=$(make config | grep "OPENSSL_VERSION=" | cut -d "=" -f 2)
7074
XZ_VERSION=$(make config | grep "XZ_VERSION=" | cut -d "=" -f 2)
75+
ZSTD_VERSION=$(make config | grep "ZSTD_VERSION=" | cut -d "=" -f 2)
7176
if [ -z "${{ inputs.build-number }}" ]; then
7277
BUILD_NUMBER=custom
7378
else
@@ -82,6 +87,7 @@ jobs:
8287
echo "MPDECIMAL_VERSION=${MPDECIMAL_VERSION}" | tee -a ${GITHUB_OUTPUT}
8388
echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT}
8489
echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT}
90+
echo "ZSTD_VERSION=${ZSTD_VERSION}" | tee -a ${GITHUB_OUTPUT}
8591
8692
build:
8793
runs-on: macOS-15
@@ -184,16 +190,16 @@ jobs:
184190

185191
cpython-testbed:
186192
name: CPython testbed (${{ matrix.platform }})
187-
# For now, CPython testbed can't run on macos-15: https://github.com/actions/runner-images/issues/12777
188-
runs-on: macOS-14
193+
runs-on: macOS-15
189194
needs: [ config, build ]
190195
strategy:
191196
fail-fast: false
192197
matrix:
193-
platform: ["iOS", "visionOS"]
198+
platform: ["iOS", "tvOS", "visionOS"]
194199
include:
195-
- platform: "iOS"
196-
testbed-args: '--simulator "iPhone 16e,arch=arm64,OS=18.5"'
200+
# Needed to disambiguate simulator options.
201+
- platform: "visionOS"
202+
testbed-args: '--simulator "Apple Vision Pro,arch=arm64,OS=2.5"'
197203

198204
steps:
199205
- uses: actions/checkout@v5
@@ -231,7 +237,7 @@ jobs:
231237
# - test_os as a test of system library calls
232238
# - test_bz2 as a simple test of third party libraries
233239
# - test_ctypes as a test of FFI
234-
python -m testbed run -- test --single-process --rerun -W test_builtin test_grammar test_os test_bz2 test_ctypes
240+
python -m testbed run --verbose ${{ matrix.testbed-args }} -- test --single-process --rerun -W test_builtin test_grammar test_os test_bz2 test_ctypes
235241
236242
crossenv-test:
237243
name: Cross-platform env test (${{ matrix.multiarch }})

Makefile

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BUILD_NUMBER=custom
1919
# of a release cycle, as official binaries won't be published.
2020
# PYTHON_MICRO_VERSION is the full version number, without any alpha/beta/rc suffix. (e.g., 3.10.0)
2121
# PYTHON_VER is the major/minor version (e.g., 3.10)
22-
PYTHON_VERSION=3.14.0rc1
22+
PYTHON_VERSION=3.14.0rc3
2323
PYTHON_PKG_VERSION=$(PYTHON_VERSION)
2424
PYTHON_MICRO_VERSION=$(shell echo $(PYTHON_VERSION) | grep -Eo "\d+\.\d+\.\d+")
2525
PYTHON_PKG_MICRO_VERSION=$(shell echo $(PYTHON_PKG_VERSION) | grep -Eo "\d+\.\d+\.\d+")
@@ -32,6 +32,7 @@ LIBFFI_VERSION=3.4.7-2
3232
MPDECIMAL_VERSION=4.0.0-2
3333
OPENSSL_VERSION=3.0.16-2
3434
XZ_VERSION=5.6.4-2
35+
ZSTD_VERSION=1.5.7-1
3536

3637
# Supported OS
3738
OS_LIST=macOS iOS tvOS watchOS visionOS
@@ -41,25 +42,30 @@ CURL_FLAGS=--disable --fail --location --create-dirs --progress-bar
4142
# macOS targets
4243
TARGETS-macOS=macosx.x86_64 macosx.arm64
4344
TRIPLE_OS-macOS=macos
45+
PLATFORM_NAME-macOS=macOS
4446
VERSION_MIN-macOS=11.0
4547

4648
# iOS targets
4749
TARGETS-iOS=iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64
4850
TRIPLE_OS-iOS=ios
51+
PLATFORM_NAME-iOS=iOS
4952
VERSION_MIN-iOS=13.0
5053

5154
# tvOS targets
5255
TARGETS-tvOS=appletvsimulator.x86_64 appletvsimulator.arm64 appletvos.arm64
5356
TRIPLE_OS-tvOS=tvos
57+
PLATFORM_NAME-tvOS=tvOS
5458
VERSION_MIN-tvOS=12.0
5559

5660
# watchOS targets
5761
TARGETS-watchOS=watchsimulator.x86_64 watchsimulator.arm64 watchos.arm64_32
5862
TRIPLE_OS-watchOS=watchos
63+
PLATFORM_NAME-watchOS=watchOS
5964
VERSION_MIN-watchOS=4.0
6065

6166
TARGETS-visionOS=xrsimulator.arm64 xros.arm64
6267
TRIPLE_OS-visionOS=xros
68+
PLATFORM_NAME-visionOS=xrOS
6369
VERSION_MIN-visionOS=2.0
6470

6571
# The architecture of the machine doing the build
@@ -95,7 +101,7 @@ update-patch:
95101
# call
96102
if [ -z "$(PYTHON_REPO_DIR)" ]; then echo "\n\nPYTHON_REPO_DIR must be set to the root of your Python github checkout\n\n"; fi
97103
cd $(PYTHON_REPO_DIR) && \
98-
git diff -D v$(PYTHON_VERSION) $(PYTHON_VER)-patched \
104+
git diff --no-renames -D v$(PYTHON_VERSION) $(PYTHON_VER)-patched \
99105
| PATH="/usr/local/bin:/opt/homebrew/bin:$(PATH)" filterdiff \
100106
-X $(PROJECT_DIR)/patch/Python/diff.exclude -p 1 --clean \
101107
> $(PROJECT_DIR)/patch/Python/Python.patch
@@ -187,6 +193,26 @@ $$(XZ_LIB-$(target)): downloads/xz-$(XZ_VERSION)-$(target).tar.gz
187193
# Ensure the target is marked as clean.
188194
touch $$(XZ_LIB-$(target))
189195

196+
###########################################################################
197+
# Target: zstd (ZStandard)
198+
###########################################################################
199+
200+
ZSTD_INSTALL-$(target)=$(PROJECT_DIR)/install/$(os)/$(target)/zstd-$(ZSTD_VERSION)
201+
ZSTD_LIB-$(target)=$$(ZSTD_INSTALL-$(target))/lib/libzstd.a
202+
203+
downloads/zstd-$(ZSTD_VERSION)-$(target).tar.gz:
204+
@echo ">>> Download zstd for $(target)"
205+
mkdir -p downloads
206+
curl $(CURL_FLAGS) -o $$@ \
207+
https://github.com/beeware/cpython-apple-source-deps/releases/download/zstd-$(ZSTD_VERSION)/zstd-$(ZSTD_VERSION)-$(target).tar.gz
208+
209+
$$(ZSTD_LIB-$(target)): downloads/zstd-$(ZSTD_VERSION)-$(target).tar.gz
210+
@echo ">>> Install zstd for $(target)"
211+
mkdir -p $$(ZSTD_INSTALL-$(target))
212+
cd $$(ZSTD_INSTALL-$(target)) && tar zxvf $(PROJECT_DIR)/downloads/zstd-$(ZSTD_VERSION)-$(target).tar.gz --exclude="*.dylib"
213+
# Ensure the target is marked as clean.
214+
touch $$(ZSTD_LIB-$(target))
215+
190216
###########################################################################
191217
# Target: mpdecimal
192218
###########################################################################
@@ -280,22 +306,23 @@ $$(PYTHON_SRCDIR-$(target))/configure: \
280306
$$(LIBFFI_LIB-$(target)) \
281307
$$(MPDECIMAL_LIB-$(target)) \
282308
$$(OPENSSL_SSL_LIB-$(target)) \
283-
$$(XZ_LIB-$(target))
309+
$$(XZ_LIB-$(target)) \
310+
$$(ZSTD_LIB-$(target))
284311
@echo ">>> Unpack and configure Python for $(target)"
285312
mkdir -p $$(PYTHON_SRCDIR-$(target))
286313
tar zxf downloads/Python-$(PYTHON_VERSION).tar.gz --strip-components 1 -C $$(PYTHON_SRCDIR-$(target))
287314
# Apply target Python patches
288315
cd $$(PYTHON_SRCDIR-$(target)) && patch -p1 < $(PROJECT_DIR)/patch/Python/Python.patch
289316
# Make sure the binary scripts are executable
290-
chmod 755 $$(PYTHON_SRCDIR-$(target))/$(os)/Resources/bin/*
317+
chmod 755 $$(PYTHON_SRCDIR-$(target))/Apple/$(os)/Resources/bin/*
291318
# Touch the configure script to ensure that Make identifies it as up to date.
292319
touch $$(PYTHON_SRCDIR-$(target))/configure
293320

294321
$$(PYTHON_SRCDIR-$(target))/Makefile: \
295322
$$(PYTHON_SRCDIR-$(target))/configure
296323
# Configure target Python
297324
cd $$(PYTHON_SRCDIR-$(target)) && \
298-
PATH="$(PROJECT_DIR)/$$(PYTHON_SRCDIR-$(target))/$(os)/Resources/bin:$(PATH)" \
325+
PATH="$(PROJECT_DIR)/$$(PYTHON_SRCDIR-$(target))/Apple/$(os)/Resources/bin:$(PATH)" \
299326
./configure \
300327
LIBLZMA_CFLAGS="-I$$(XZ_INSTALL-$(target))/include" \
301328
LIBLZMA_LIBS="-L$$(XZ_INSTALL-$(target))/lib -llzma" \
@@ -305,6 +332,8 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
305332
LIBMPDEC_LIBS="-L$$(MPDECIMAL_INSTALL-$(target))/lib -lmpdec" \
306333
LIBFFI_CFLAGS="-I$$(LIBFFI_INSTALL-$(target))/include" \
307334
LIBFFI_LIBS="-L$$(LIBFFI_INSTALL-$(target))/lib -lffi" \
335+
LIBZSTD_CFLAGS="-I$$(ZSTD_INSTALL-$(target))/include" \
336+
LIBZSTD_LIBS="-L$$(ZSTD_INSTALL-$(target))/lib -lzstd" \
308337
--host=$$(TARGET_TRIPLE-$(target)) \
309338
--build=$(HOST_ARCH)-apple-darwin \
310339
--with-build-python=$(HOST_PYTHON) \
@@ -317,14 +346,14 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
317346
$$(PYTHON_SRCDIR-$(target))/python.exe: $$(PYTHON_SRCDIR-$(target))/Makefile
318347
@echo ">>> Build Python for $(target)"
319348
cd $$(PYTHON_SRCDIR-$(target)) && \
320-
PATH="$(PROJECT_DIR)/$$(PYTHON_SRCDIR-$(target))/$(os)/Resources/bin:$(PATH)" \
349+
PATH="$(PROJECT_DIR)/$$(PYTHON_SRCDIR-$(target))/Apple/$(os)/Resources/bin:$(PATH)" \
321350
make -j8 all \
322351
2>&1 | tee -a ../python-$(PYTHON_VERSION).build.log
323352

324353
$$(PYTHON_LIB-$(target)): $$(PYTHON_SRCDIR-$(target))/python.exe
325354
@echo ">>> Install Python for $(target)"
326355
cd $$(PYTHON_SRCDIR-$(target)) && \
327-
PATH="$(PROJECT_DIR)/$$(PYTHON_SRCDIR-$(target))/$(os)/Resources/bin:$(PATH)" \
356+
PATH="$(PROJECT_DIR)/$$(PYTHON_SRCDIR-$(target))/Apple/$(os)/Resources/bin:$(PATH)" \
328357
make install \
329358
2>&1 | tee -a ../python-$(PYTHON_VERSION).install.log
330359

@@ -490,15 +519,11 @@ $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h: $$(PYTHON_LIB-$(sdk))
490519
mkdir -p $$(PYTHON_INSTALL-$(sdk))/include
491520
ln -si ../Python.framework/Headers $$(PYTHON_INSTALL-$(sdk))/include/python$(PYTHON_VER)
492521

493-
ifeq ($(os), visionOS)
494-
echo "Skipping arch-specific header copying for visionOS"
495-
else
496522
# Add the individual headers from each target in an arch-specific name
497523
$$(foreach target,$$(SDK_TARGETS-$(sdk)),cp $$(PYTHON_INCLUDE-$$(target))/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig-$$(ARCH-$$(target)).h; )
498524

499525
# Copy the cross-target header from the source folder of the first target in the $(sdk) SDK
500-
cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$(sdk))))/$(os)/Resources/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h
501-
endif
526+
cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$(sdk))))/Apple/$(os)/Resources/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h
502527

503528

504529
$$(PYTHON_STDLIB-$(sdk))/LICENSE.TXT: $$(PYTHON_LIB-$(sdk)) $$(PYTHON_FRAMEWORK-$(sdk))/Info.plist $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h $$(foreach target,$$(SDK_TARGETS-$(sdk)),$$(PYTHON_PLATFORM_SITECUSTOMIZE-$$(target)))
@@ -666,6 +691,11 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
666691
-output $$(PYTHON_XCFRAMEWORK-$(os)) $$(foreach sdk,$$(SDKS-$(os)),-framework $$(PYTHON_FRAMEWORK-$$(sdk))) \
667692
2>&1 | tee -a support/$(PYTHON_VER)/python-$(os).xcframework.log
668693

694+
@echo ">>> Install build tools for $(os)"
695+
mkdir $$(PYTHON_XCFRAMEWORK-$(os))/build
696+
cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/Apple/testbed/Python.xcframework/build/utils.sh $$(PYTHON_XCFRAMEWORK-$(os))/build
697+
cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/Apple/testbed/Python.xcframework/build/$$(PLATFORM_NAME-$(os))-dylib-Info-template.plist $$(PYTHON_XCFRAMEWORK-$(os))/build
698+
669699
@echo ">>> Install PYTHONHOME for $(os)"
670700
$$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/include $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
671701
$$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/bin $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
@@ -674,9 +704,9 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
674704
# Disable dSYM production (for now)
675705
# $$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/Python.dSYM $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
676706

677-
ifeq ($(filter $(os),iOS visionOS),$(os))
707+
ifeq ($(filter $(os),iOS tvOS visionOS),$(os))
678708
@echo ">>> Clone testbed project for $(os)"
679-
$(HOST_PYTHON) $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/$(os)/testbed clone --framework $$(PYTHON_XCFRAMEWORK-$(os)) support/$(PYTHON_VER)/$(os)/testbed
709+
$(HOST_PYTHON) $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/Apple/testbed clone --platform $(os) --framework $$(PYTHON_XCFRAMEWORK-$(os)) support/$(PYTHON_VER)/$(os)/testbed
680710
endif
681711

682712
@echo ">>> Create VERSIONS file for $(os)"
@@ -689,6 +719,7 @@ endif
689719
echo "mpdecimal: $(MPDECIMAL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
690720
echo "OpenSSL: $(OPENSSL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
691721
echo "XZ: $(XZ_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
722+
echo "Zstandard: $(ZSTD_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
692723

693724
dist/Python-$(PYTHON_VER)-$(os)-support.$(BUILD_NUMBER).tar.gz: \
694725
$$(PYTHON_XCFRAMEWORK-$(os))/Info.plist \
@@ -757,6 +788,7 @@ config:
757788
@echo "MPDECIMAL_VERSION=$(MPDECIMAL_VERSION)"
758789
@echo "OPENSSL_VERSION=$(OPENSSL_VERSION)"
759790
@echo "XZ_VERSION=$(XZ_VERSION)"
791+
@echo "ZSTD_VERSION=$(ZSTD_VERSION)"
760792

761793
# Expand cross-platform build and clean targets for each output product
762794
clean: $(foreach os,$(OS_LIST),clean-$(os))

0 commit comments

Comments
 (0)