Skip to content

chore: add experimental python 314 support#129

Open
ryanking13 wants to merge 16 commits into
mainfrom
gyeongjae/experimental-python314
Open

chore: add experimental python 314 support#129
ryanking13 wants to merge 16 commits into
mainfrom
gyeongjae/experimental-python314

Conversation

@ryanking13

@ryanking13 ryanking13 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Adds python 3.14 support on pywrangler. This compat flag is not enabled by date yet, so we are setting the explicit compat flag on our test.

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Missing negative test for experimental gating — The new test covers the case where experimental is present, but there is no test verifying that pythonWorkers20260610 is ignored when experimental is absent. This is the most important behavior to validate for the gating logic.

  2. Placeholder Pyodide index version 314.0.0get_pyodide_index() maps 3.14 to version 314.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.

  3. Compat flag naming convention — The new flag pythonWorkers20260610 uses 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.

Comment thread packages/cli/tests/test_py_version_detect.py
Comment thread packages/cli/src/pywrangler/utils.py Outdated
@ask-bonk

ask-bonk Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review posted successfully on PR #129. Here's a summary of what I flagged:

  1. Missing negative test (highest priority) — There's no test verifying that pythonWorkers20260610 is ignored when the experimental flag is absent. I posted a suggestion with a concrete test case at packages/cli/tests/test_py_version_detect.py:190.

  2. Placeholder Pyodide index version314.0.0 in get_pyodide_index() will silently produce a broken URL if someone enables experimental mode today. Flagged at packages/cli/src/pywrangler/utils.py:417.

  3. Compat flag naming convention — The new pythonWorkers20260610 flag uses camelCase unlike existing snake_case flags. Noted in the review body for the author to confirm if intentional.

github run

@ryanking13 ryanking13 changed the title [DRAFT] chore: add experimental python 314 support chore: add experimental python 314 support Jul 8, 2026
Comment thread packages/cli/src/pywrangler/utils.py Outdated

MIN_UV_VERSION = (0, 8, 10)
MIN_WRANGLER_VERSION = (4, 42, 1)
MIN_WRANGLER_VERSION = (4, 108, 0)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wrangler version includes python 314 support.

class Default(WorkerEntrypoint):
async def test(self):
if sys.version_info >= (3, 14):
# FIXME(soon): fix entropy patches for newer packages

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pydantic-core issue. We need to fix this, but it should be done in a separate PR.

def fetch_check(url, opts):
assert opts.foobarbaz == 42

async with mock_fetch(fetch_check):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this one in our internal workerd tests as well. It mocks pyfetch internal which is easy to break + does not add much value for testing.

@ryanking13 ryanking13 marked this pull request as ready for review July 8, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant