Skip to content

Commit 9491418

Browse files
committed
Add Python 3.14
1 parent a965cfe commit 9491418

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

cpython-unix/build-cpython.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ cat Makefile.extra
7272
pushd Python-${PYTHON_VERSION}
7373

7474
# configure doesn't support cross-compiling on Apple. Teach it.
75-
if [ "${PYTHON_MAJMIN_VERSION}" = "3.13" ]; then
75+
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then
7676
patch -p1 -i ${ROOT}/patch-apple-cross-3.13.patch
7777
elif [ "${PYTHON_MAJMIN_VERSION}" = "3.12" ]; then
7878
patch -p1 -i ${ROOT}/patch-apple-cross-3.12.patch
@@ -786,7 +786,7 @@ s390x-unknown-linux-gnu)
786786
x86_64-unknown-linux-*)
787787
# In Python 3.13+, the musl target is identified in cross compiles and the output directory
788788
# is named accordingly.
789-
if [ "${CC}" = "musl-clang" ] && [ "${PYTHON_MAJMIN_VERSION}" = "3.13" ]; then
789+
if [ "${CC}" = "musl-clang" ] && [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then
790790
PYTHON_ARCH="x86_64-linux-musl"
791791
else
792792
PYTHON_ARCH="x86_64-linux-gnu"

cpython-unix/extension-modules.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,18 @@ _bisect:
1919
- _bisectmodule.c
2020

2121
_blake2:
22-
sources:
23-
- _blake2/blake2module.c
24-
- _blake2/blake2b_impl.c
25-
- _blake2/blake2s_impl.c
22+
includes-conditional:
23+
- path: Modules/_hacl/include
24+
minimum-python-version: "3.14"
25+
sources-conditional:
26+
- source: _blake2/blake2module.c
27+
maximum-python-version: "3.13"
28+
- source: _blake2/blake2b_impl.c
29+
maximum-python-version: "3.13"
30+
- source: _blake2/blake2s_impl.c
31+
maximum-python-version: "3.13"
32+
- source: blake2module.c
33+
minimum-python-version: "3.14"
2634

2735
_bz2:
2836
sources:
@@ -355,6 +363,9 @@ _multiprocessing:
355363
_opcode:
356364
sources:
357365
- _opcode.c
366+
setup-enabled-conditional:
367+
- enabled: true
368+
minimum-python-version: "3.14"
358369

359370
_operator:
360371
setup-enabled: true

src/validation.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ const GLOBAL_EXTENSIONS: &[&str] = &[
676676
// _sha256 and _sha512 merged into _sha2 in 3.12.
677677
// _xxinterpchannels added in 3.12.
678678
// audioop removed in 3.13.
679+
// annotationlib added in 3.14.
679680

680681
// We didn't build ctypes_test until 3.9.
681682
// We didn't build some test extensions until 3.9.
@@ -738,6 +739,7 @@ const GLOBAL_EXTENSIONS_PYTHON_3_14: &[&str] = &[
738739
"_tokenize",
739740
"_typing",
740741
"_zoneinfo",
742+
"annotationlib",
741743
];
742744

743745
const GLOBAL_EXTENSIONS_MACOS: &[&str] = &["_scproxy"];
@@ -1490,7 +1492,7 @@ fn validate_extension_modules(
14901492

14911493
if is_macos {
14921494
wanted.extend(GLOBAL_EXTENSIONS_POSIX);
1493-
if python_major_minor == "3.13" {
1495+
if matches!(python_major_minor, "3.13" | "3.14") {
14941496
wanted.remove("_crypt");
14951497
}
14961498
wanted.extend(GLOBAL_EXTENSIONS_MACOS);
@@ -1514,7 +1516,7 @@ fn validate_extension_modules(
15141516
wanted.extend(GLOBAL_EXTENSIONS_POSIX);
15151517
// TODO: If there are more differences for `GLOBAL_EXTENSIONS_POSIX` in future Python
15161518
// versions, we should move the `_crypt` special-case into a constant
1517-
if python_major_minor == "3.13" {
1519+
if matches!(python_major_minor, "3.13" | "3.14") {
15181520
wanted.remove("_crypt");
15191521
}
15201522
if matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12") {
@@ -1527,12 +1529,7 @@ fn validate_extension_modules(
15271529
}
15281530
}
15291531

1530-
if (is_linux || is_macos)
1531-
&& matches!(
1532-
python_major_minor,
1533-
"3.9" | "3.10" | "3.11" | "3.12" | "3.13"
1534-
)
1535-
{
1532+
if (is_linux || is_macos) {
15361533
wanted.extend([
15371534
"_testbuffer",
15381535
"_testimportmultiple",
@@ -1541,16 +1538,16 @@ fn validate_extension_modules(
15411538
]);
15421539
}
15431540

1544-
if (is_linux || is_macos) && python_major_minor == "3.13" {
1541+
if (is_linux || is_macos) && matches!(python_major_minor, "3.13" | "3.14") {
15451542
wanted.extend(["_suggestions", "_testexternalinspection"]);
15461543
}
15471544

1548-
if (is_linux || is_macos) && matches!(python_major_minor, "3.12" | "3.13") {
1545+
if (is_linux || is_macos) && matches!(python_major_minor, "3.12" | "3.13" | "3.14") {
15491546
wanted.insert("_testsinglephase");
15501547
}
15511548

15521549
// _wmi is Windows only on 3.12+.
1553-
if matches!(python_major_minor, "3.12" | "3.13") && is_windows {
1550+
if matches!(python_major_minor, "3.12" | "3.13" | "3.14") && is_windows {
15541551
wanted.insert("_wmi");
15551552
}
15561553

@@ -1673,6 +1670,8 @@ fn validate_distribution(
16731670
"3.12"
16741671
} else if dist_filename.starts_with("cpython-3.13.") {
16751672
"3.13"
1673+
} else if dist_filename.starts_with("cpython-3.14.") {
1674+
"3.14"
16761675
} else {
16771676
return Err(anyhow!("could not parse Python version from filename"));
16781677
};
@@ -1955,7 +1954,7 @@ fn validate_distribution(
19551954
false
19561955
// For some strange reason _PyWarnings_Init is exported as part of the ABI
19571956
} else if name == "_warnings" {
1958-
// But not on Python 3.13 on Windows
1957+
// But not on Python 3.13+ on Windows
19591958
if triple.contains("-windows-") {
19601959
matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12")
19611960
} else {

0 commit comments

Comments
 (0)