[DRAFT] chore: add experimental python 314 support#129
Conversation
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR adds experimental Python 3.14 support, gated behind an experimental compat flag.
Issues
-
Missing negative test for experimental gating — The new test covers the case where
experimentalis present, but there is no test verifying thatpythonWorkers20260610is ignored whenexperimentalis absent. This is the most important behavior to validate for the gating logic. -
Placeholder Pyodide index version
314.0.0—get_pyodide_index()maps 3.14 to version314.0.0, which is clearly a placeholder. If someone enables the experimental flag today, they'll get a broken index URL with no clear error message. Consider adding a comment explaining this is a placeholder, or raising an error until the real version is known. -
Compat flag naming convention — The new flag
pythonWorkers20260610uses camelCase, while existing flags (python_workers,python_workers_20250116) use snake_case. This may be intentional to match the workerd side, but it's worth a note if so.
| """) | ||
|
|
||
| version = get_python_version() | ||
| assert version == "3.14" |
There was a problem hiding this comment.
This test covers the happy path, but there's no test for when pythonWorkers20260610 is present without the experimental flag. That's the key scenario the gating logic protects against — please add a negative test to verify it falls back to an earlier version.
| assert version == "3.14" | |
| version = get_python_version() | |
| assert version == "3.14" | |
| def test_314_compat_flag_without_experimental(test_dir): | |
| """Test that Python 3.14 is NOT selected without the experimental flag.""" | |
| wrangler_toml = test_dir / "wrangler.toml" | |
| wrangler_toml.write_text(""" | |
| name = "test-worker" | |
| compatibility_flags = ["python_workers", "pythonWorkers20260610"] | |
| compatibility_date = "2026-06-10" | |
| """) | |
| version = get_python_version() | |
| assert version == "3.12" |
| case "3.13": | ||
| v = "0.28.3" | ||
| case "3.14": | ||
| v = "314.0.0" |
There was a problem hiding this comment.
314.0.0 is clearly a placeholder. If someone enables the experimental flag today, pywrangler sync will silently try to fetch from a non-existent index URL. Consider adding a comment, or raising an explicit error until a real Pyodide build for 3.14 is available.
There was a problem hiding this comment.
experimental flag will fail on publish for non-Cloudflare employees so it is safe.
|
Review posted successfully on PR #129. Here's a summary of what I flagged:
|
This should not be merged until we land Python 314 support to workerd.