Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility date for Pyodide 0.26.4 #3268

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/workerd/io/compatibility-date.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -673,4 +673,11 @@ struct CompatibilityFlags @0x8f8c1b68151b6cef {
tailWorkerUserSpans @69 :Bool
$compatEnableFlag("tail_worker_user_spans")
$experimental;

pythonWorkers20241218 @70 :Bool
$compatEnableFlag("python_workers_20241218")
$experimental
$pythonSnapshotRelease(pyodide = "0.26.4", pyodideRevision = "2024-12-18",
packages = "2024-12-18", backport = 0,
baselineSnapshotHash = "TODO");
danlapid marked this conversation as resolved.
Show resolved Hide resolved
}
9 changes: 8 additions & 1 deletion src/workerd/server/tests/python/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ py_wd_test(
],
)

gen_import_tests(PYODIDE_IMPORTS_TO_TEST)
gen_import_tests(
PYODIDE_IMPORTS_TO_TEST,
# TODO: Micropip version mismatch for 0.26.4
pkg_python_versions = {"micropip": [
"0.26.0a2",
"development",
]},
)
3 changes: 2 additions & 1 deletion src/workerd/server/tests/python/import_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def generate_wd_test_file(requirement):
return WD_FILE_TEMPLATE.format(requirement, requirement)

# to_test is a dictionary from library name to list of imports
def gen_import_tests(to_test):
def gen_import_tests(to_test, pkg_python_versions = {}):
for lib in to_test.keys():
prefix = "import/" + lib
worker_py_fname = prefix + "/worker.py"
Expand All @@ -52,6 +52,7 @@ def gen_import_tests(to_test):
name = prefix,
directory = lib,
src = wd_test_fname,
python_flags = pkg_python_versions.get(lib, "all"),
args = ["--experimental", "--pyodide-package-disk-cache-dir", "../all_pyodide_wheels"],
data = [worker_py_fname, "@all_pyodide_wheels//:whls"],
size = "enormous",
Expand Down
6 changes: 4 additions & 2 deletions src/workerd/server/tests/python/py_wd_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("//:build/wd_test.bzl", "wd_test")

FEATURE_FLAGS = {
"0.26.0a2": ["python_workers"],
"0.26.0a2": [],
"0.26.4": ["python_workers_20241218"],
"development": ["python_workers_development"],
}

Expand Down Expand Up @@ -37,7 +38,8 @@ def py_wd_test(
name_flag = name + "_" + python_flag
templated_src = name_flag.replace("/", "-") + "@template"
templated_src = "/".join(src.split("/")[:-1] + [templated_src])
feature_flags_txt = ",".join(['"{}"'.format(flag) for flag in FEATURE_FLAGS[python_flag]])
flags = FEATURE_FLAGS[python_flag] + ["python_workers"]
feature_flags_txt = ",".join(['"{}"'.format(flag) for flag in flags])
expand_template(
name = name_flag + "@rule",
out = templated_src,
Expand Down
Loading