Skip to content

Commit 222a5f4

Browse files
committed
Add compatibility date for Pyodide 0.27.1
1 parent f15ac0f commit 222a5f4

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

src/workerd/io/compatibility-date.capnp

+7
Original file line numberDiff line numberDiff line change
@@ -679,4 +679,11 @@ struct CompatibilityFlags @0x8f8c1b68151b6cef {
679679
$compatDisableFlag("cache_no_cache_disabled")
680680
$experimental;
681681
# Enables the use of cache: no-cache in the fetch api.
682+
683+
pythonWorkers20250116 @71 :Bool
684+
$compatEnableFlag("python_workers_20250116")
685+
$experimental
686+
$pythonSnapshotRelease(pyodide = "0.27.1", pyodideRevision = "2025-01-16",
687+
packages = "2024-12-18", backport = 1,
688+
baselineSnapshotHash = "TODO");
682689
}

src/workerd/server/tests/python/BUILD.bazel

+8-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,11 @@ py_wd_test(
3838
],
3939
)
4040

41-
gen_import_tests(PYODIDE_IMPORTS_TO_TEST)
41+
gen_import_tests(
42+
PYODIDE_IMPORTS_TO_TEST,
43+
# TODO: Micropip version mismatch for 0.27.0
44+
pkg_python_versions = {"micropip": [
45+
"0.26.0a2",
46+
"development",
47+
]},
48+
)

src/workerd/server/tests/python/import_tests.bzl

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def generate_wd_test_file(requirement):
3232
return WD_FILE_TEMPLATE.format(requirement, requirement)
3333

3434
# to_test is a dictionary from library name to list of imports
35-
def gen_import_tests(to_test):
35+
def gen_import_tests(to_test, pkg_python_versions = {}):
3636
for lib in to_test.keys():
3737
prefix = "import/" + lib
3838
worker_py_fname = prefix + "/worker.py"
@@ -52,6 +52,7 @@ def gen_import_tests(to_test):
5252
name = prefix,
5353
directory = lib,
5454
src = wd_test_fname,
55+
python_flags = pkg_python_versions.get(lib, "all"),
5556
args = ["--experimental", "--pyodide-package-disk-cache-dir", "../all_pyodide_wheels"],
5657
data = [worker_py_fname, "@all_pyodide_wheels//:whls"],
5758
size = "enormous",

src/workerd/server/tests/python/py_wd_test.bzl

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
22
load("//:build/wd_test.bzl", "wd_test")
33

44
FEATURE_FLAGS = {
5-
"0.26.0a2": ["python_workers"],
5+
"0.26.0a2": [],
6+
"0.27.0": ["python_workers_20250116"],
67
"development": ["python_workers_development", "python_external_packages"],
78
}
89

@@ -37,7 +38,8 @@ def py_wd_test(
3738
name_flag = name + "_" + python_flag
3839
templated_src = name_flag.replace("/", "-") + "@template"
3940
templated_src = "/".join(src.split("/")[:-1] + [templated_src])
40-
feature_flags_txt = ",".join(['"{}"'.format(flag) for flag in FEATURE_FLAGS[python_flag]])
41+
flags = FEATURE_FLAGS[python_flag] + ["python_workers"]
42+
feature_flags_txt = ",".join(['"{}"'.format(flag) for flag in flags])
4143
expand_template(
4244
name = name_flag + "@rule",
4345
out = templated_src,

0 commit comments

Comments
 (0)