Skip to content

Commit

Permalink
Add support for Python 3.14 on GNU Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Dec 18, 2024
1 parent cb332f8 commit 2ac4fd6
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 4 deletions.
9 changes: 9 additions & 0 deletions ci-targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ linux:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
build_options:
- debug
- noopt
Expand All @@ -69,6 +70,7 @@ linux:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
build_options:
- debug
- noopt
Expand All @@ -89,6 +91,7 @@ linux:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
build_options:
- debug
- noopt
Expand All @@ -109,6 +112,7 @@ linux:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
build_options:
- debug
- noopt
Expand All @@ -129,6 +133,7 @@ linux:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
build_options:
- debug
- noopt
Expand All @@ -149,6 +154,7 @@ linux:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
build_options:
- debug
- pgo
Expand All @@ -171,6 +177,7 @@ linux:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
build_options:
- debug
- pgo
Expand All @@ -193,6 +200,7 @@ linux:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
build_options:
- debug
- pgo
Expand All @@ -215,6 +223,7 @@ linux:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
build_options:
- debug
- noopt
Expand Down
2 changes: 1 addition & 1 deletion cpython-unix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BUILD := $(HERE)/build.py
NULL :=
SPACE := $(subst ,, )

ALL_PYTHON_VERSIONS := 3.9 3.10 3.11 3.12 3.13
ALL_PYTHON_VERSIONS := 3.9 3.10 3.11 3.12 3.13 3.14

ifndef PYBUILD_TARGET_TRIPLE
$(error PYBUILD_TARGET_TRIPLE not defined)
Expand Down
3 changes: 2 additions & 1 deletion cpython-unix/build-main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def main():
"cpython-3.11",
"cpython-3.12",
"cpython-3.13",
"cpython-3.14",
},
default="cpython-3.11",
help="Python distribution to build",
Expand Down Expand Up @@ -164,7 +165,7 @@ def main():
release_tag = release_tag_from_git()

# Guard against accidental misuse of the free-threaded flag with older versions
if "freethreaded" in args.options and python_majmin not in ("3.13",):
if "freethreaded" in args.options and python_majmin not in ("3.13", "3.14"):
print(
"Invalid build option: 'freethreaded' is only compatible with CPython 3.13+ (got %s)"
% cpython_version
Expand Down
5 changes: 3 additions & 2 deletions cpython-unix/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def build_cpython_host(

# Set environment variables allowing convenient testing for Python
# version ranges.
for v in ("3.9", "3.10", "3.11", "3.12", "3.13"):
for v in ("3.9", "3.10", "3.11", "3.12", "3.13", "3.14"):
normal_version = v.replace(".", "_")

if meets_python_minimum_version(python_version, v):
Expand Down Expand Up @@ -801,7 +801,7 @@ def build_cpython(

# Set environment variables allowing convenient testing for Python
# version ranges.
for v in ("3.9", "3.10", "3.11", "3.12", "3.13"):
for v in ("3.9", "3.10", "3.11", "3.12", "3.13", "3.14"):
normal_version = v.replace(".", "_")

if meets_python_minimum_version(python_version, v):
Expand Down Expand Up @@ -1223,6 +1223,7 @@ def main():
"cpython-3.11",
"cpython-3.12",
"cpython-3.13",
"cpython-3.14",
):
build_cpython(
settings,
Expand Down
3 changes: 3 additions & 0 deletions cpython-unix/extension-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ _multiprocessing:
_opcode:
sources:
- _opcode.c
setup-enabled-conditional:
- enabled: true
minimum-python-version: "3.14"

_operator:
setup-enabled: true
Expand Down
18 changes: 18 additions & 0 deletions cpython-unix/targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ aarch64-apple-darwin:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
host_cc: clang
host_cxx: clang++
Expand Down Expand Up @@ -153,6 +154,7 @@ aarch64-unknown-linux-gnu:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
docker_image_suffix: .cross
host_cc: /usr/bin/x86_64-linux-gnu-gcc
host_cxx: /usr/bin/x86_64-linux-gnu-g++
Expand Down Expand Up @@ -232,6 +234,7 @@ armv7-unknown-linux-gnueabi:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
docker_image_suffix: .cross
host_cc: /usr/bin/x86_64-linux-gnu-gcc
host_cxx: /usr/bin/x86_64-linux-gnu-g++
Expand Down Expand Up @@ -271,6 +274,7 @@ armv7-unknown-linux-gnueabihf:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
docker_image_suffix: .cross
host_cc: /usr/bin/x86_64-linux-gnu-gcc
host_cxx: /usr/bin/x86_64-linux-gnu-g++
Expand Down Expand Up @@ -310,6 +314,7 @@ i686-unknown-linux-gnu:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
host_cc: clang
host_cxx: clang++
Expand Down Expand Up @@ -354,6 +359,7 @@ mips-unknown-linux-gnu:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
docker_image_suffix: .cross
host_cc: /usr/bin/x86_64-linux-gnu-gcc
host_cxx: /usr/bin/x86_64-linux-gnu-g++
Expand Down Expand Up @@ -393,6 +399,7 @@ mipsel-unknown-linux-gnu:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
docker_image_suffix: .cross
host_cc: /usr/bin/x86_64-linux-gnu-gcc
host_cxx: /usr/bin/x86_64-linux-gnu-g++
Expand Down Expand Up @@ -432,6 +439,7 @@ ppc64le-unknown-linux-gnu:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
docker_image_suffix: .cross
host_cc: /usr/bin/x86_64-linux-gnu-gcc
host_cxx: /usr/bin/x86_64-linux-gnu-g++
Expand Down Expand Up @@ -471,6 +479,7 @@ s390x-unknown-linux-gnu:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
docker_image_suffix: .cross
host_cc: /usr/bin/x86_64-linux-gnu-gcc
host_cxx: /usr/bin/x86_64-linux-gnu-g++
Expand Down Expand Up @@ -554,6 +563,7 @@ x86_64-apple-darwin:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
apple_sdk_platform: macosx
host_cc: clang
Expand Down Expand Up @@ -723,6 +733,7 @@ x86_64-unknown-linux-gnu:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
host_cc: clang
host_cxx: clang++
Expand Down Expand Up @@ -767,6 +778,7 @@ x86_64_v2-unknown-linux-gnu:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
host_cc: clang
host_cxx: clang++
Expand Down Expand Up @@ -812,6 +824,7 @@ x86_64_v3-unknown-linux-gnu:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
host_cc: clang
host_cxx: clang++
Expand Down Expand Up @@ -857,6 +870,7 @@ x86_64_v4-unknown-linux-gnu:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
host_cc: clang
host_cxx: clang++
Expand Down Expand Up @@ -902,6 +916,7 @@ x86_64-unknown-linux-musl:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
host_cc: clang
host_cxx: clang++
Expand Down Expand Up @@ -944,6 +959,7 @@ x86_64_v2-unknown-linux-musl:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
host_cc: clang
host_cxx: clang++
Expand Down Expand Up @@ -987,6 +1003,7 @@ x86_64_v3-unknown-linux-musl:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
host_cc: clang
host_cxx: clang++
Expand Down Expand Up @@ -1030,6 +1047,7 @@ x86_64_v4-unknown-linux-musl:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
needs_toolchain: true
host_cc: clang
host_cxx: clang++
Expand Down
9 changes: 9 additions & 0 deletions pythonbuild/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@
"license_file": "LICENSE.cpython.txt",
"python_tag": "cp313",
},
"cpython-3.14": {
"url": "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a3.tar.xz",
"size": 22749680,
"sha256": "94349df207456a575a8867c20b4ca434f870e1920dcdcc8fdf797e1af49abe90",
"version": "3.14.0a3",
"licenses": ["Python-2.0", "CNRI-Python"],
"license_file": "LICENSE.cpython.txt",
"python_tag": "cp314",
},
"expat": {
"url": "https://github.com/libexpat/libexpat/releases/download/R_2_6_3/expat-2.6.3.tar.xz",
"size": 485600,
Expand Down
2 changes: 2 additions & 0 deletions src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,8 @@ fn validate_distribution(
"3.12"
} else if dist_filename.starts_with("cpython-3.13.") {
"3.13"
} else if dist_filename.starts_with("cpython-3.14.") {
"3.14"
} else {
return Err(anyhow!("could not parse Python version from filename"));
};
Expand Down

0 comments on commit 2ac4fd6

Please sign in to comment.