Skip to content

Commit c9292a4

Browse files
committed
Update python-build-standalone, now supporting Python 3.13.2
1 parent eb6a806 commit c9292a4

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ concurrency:
1818

1919
# Global Settings
2020
env:
21-
PYTHON_VERSION: "3.12" # Python to run the build, no the one shipped !
21+
PYTHON_VERSION: "3.13" # Python to run the build, no the one shipped !
2222
BLEEDING_EDGE_GODOT: false
2323

2424

meson.build

+6-1
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,18 @@ if build_machine.system() == 'linux'
204204
mm = '@0@.@1@'.format(cpython_distrib_version_major, cpython_distrib_version_minor)
205205
bad_links = [
206206
# (<parent dir>, <symlink name>, <target name>)
207-
['bin', '2to3', '2to3-@0@'.format(mm)],
208207
['bin', 'idle3', 'idle@0@'.format(mm)],
209208
['bin', 'pydoc3', 'pydoc@0@'.format(mm)],
210209
['bin', 'python3', 'python@0@'.format(mm)],
211210
['bin', 'python3-config', 'python@0@-config'.format(mm)],
212211
['lib', 'libpython@[email protected]'.format(mm), 'libpython@[email protected]'.format(mm)],
213212
]
213+
# 2to3 was removed in Python 3.13
214+
if cpython_distrib_version_minor.to_int() < 13
215+
bad_links += [
216+
['bin', '2to3', '2to3-@0@'.format(mm)],
217+
]
218+
endif
214219
foreach x: bad_links
215220
parent_dir = x[0]
216221
symlink_name = x[1]

meson_options.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
option('cpython_distrib_version', type: 'string', value: '3.12.4', description: 'Version of CPython to ship')
1+
option('cpython_distrib_version', type: 'string', value: '3.13.2', description: 'Version of CPython to ship')
22
option('gdextension_path', type: 'string', value: '', description: 'Use GDExtension API at this location instead of generating it from Godot binary')
33
option('godot_version', type: 'string', value: '4.2.2', description: 'Version of Godot to generate GDExtension API from')
44
option('real_is_double', type: 'boolean', value: false, description: 'Built for Godot with 64bits floating point numbers (i.e. double) in builtins instead of 32bits (i.e. float)')

scripts/python_distrib.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import argparse
44
from pathlib import Path
5+
import re
56
from urllib.request import urlopen
67
import shutil
78
import tarfile
@@ -10,8 +11,14 @@
1011
import zstandard
1112

1213

13-
PREBUILDS_BASE_URL = "https://github.com/indygreg/python-build-standalone/releases/download"
14+
PREBUILDS_BASE_URL = "https://github.com/astral-sh/python-build-standalone/releases/download"
1415
PLATFORM_TO_PREBUILDS = {
16+
"3.13.2": {
17+
"linux-x86_64": f"{PREBUILDS_BASE_URL}/20250205/cpython-3.13.2+20250205-x86_64_v3-unknown-linux-gnu-pgo+lto-full.tar.zst",
18+
"windows-x86": f"{PREBUILDS_BASE_URL}/20250205/cpython-3.13.2+20250205-i686-pc-windows-msvc-shared-pgo-full.tar.zst",
19+
"windows-x86_64": f"{PREBUILDS_BASE_URL}/20250205/cpython-3.13.2+20250205-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst",
20+
"macos-x86_64": f"{PREBUILDS_BASE_URL}/20250205/cpython-3.13.2+20250205-x86_64-apple-darwin-pgo+lto-full.tar.zst",
21+
},
1522
"3.12.4": {
1623
"linux-x86_64": f"{PREBUILDS_BASE_URL}/20240713/cpython-3.12.4+20240713-x86_64-unknown-linux-gnu-pgo+lto-full.tar.zst",
1724
"windows-x86": f"{PREBUILDS_BASE_URL}/20240713/cpython-3.12.4+20240713-i686-pc-windows-msvc-shared-pgo-full.tar.zst",
@@ -105,15 +112,19 @@ def _tar_extract(reader):
105112

106113
def load_config(prebuild_dir: Path) -> dict:
107114
conf = json.loads((prebuild_dir / "python/PYTHON.json").read_text())
108-
assert conf["version"] == "7"
115+
assert conf["version"] in (
116+
"7",
117+
"8",
118+
), f"Unsupported PYTHON.json format version {conf['version']}"
109119
assert conf["libpython_link_mode"] == "shared"
110120
return conf
111121

112122

113123
def install_linux(conf: dict, build_dir: Path, prebuild_dir: Path, compressed_stdlib: bool) -> None:
114124
print(f"Create clean distribution {build_dir}...")
115125

116-
if conf["target_triple"] not in ("x86_64-unknown-linux-gnu", "x86-unknown-linux-gnu"):
126+
# See https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions
127+
if not re.match(r"^x86_64(|_v2|_v3|_v4)-unknown-linux-(gnu|musl)$", conf["target_triple"]):
117128
raise RuntimeError(f"Unexpected target_triple `{conf['target_triple']}`")
118129
major, minor = conf["python_major_minor_version"].split(".")
119130

0 commit comments

Comments
 (0)