-
Notifications
You must be signed in to change notification settings - Fork 14
chore: add experimental python 314 support #129
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
Open
ryanking13
wants to merge
16
commits into
main
Choose a base branch
from
gyeongjae/experimental-python314
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4b9d656
chore: add experimental python 314 support
ryanking13 0fec73f
Merge remote-tracking branch 'origin' into gyeongjae/experimental-pyt…
ryanking13 bac2b34
chore: run ci with python 314
ryanking13 2585ca0
chore: bump minimum wrangler version
ryanking13 e707688
chore: update unittest to set compat flags
ryanking13 0ddf404
Merge remote-tracking branch 'origin/main' into gyeongjae/experimenta…
ryanking13 1131d97
chore: update min wrangler version
ryanking13 f08ba73
chore: cleanup compat flags
ryanking13 f4ff0e1
chore: fix asyncio loop problem
ryanking13 86edf8d
chore: remove default.profraw
ryanking13 462c8f3
chore: fix tests
ryanking13 6bd0922
Merge remote-tracking branch 'origin/main' into gyeongjae/experimenta…
ryanking13 f210729
chore: use wrnangler 109, 108 is yanked
ryanking13 96f3021
Merge remote-tracking branch 'origin/main' into gyeongjae/experimenta…
ryanking13 a5cda04
chore: fix wsgi test
ryanking13 c601221
chore: lint
ryanking13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,50 @@ | ||
| # Compat dates used to parametrize workerd and bindings integration tests. | ||
| # Each date exercises a different Python version inside the worker runtime: | ||
| # - "2025-09-01" -> Python 3.12 (before the 2025-09-29 cutover) | ||
| # - "2026-01-01" -> Python 3.13 (after the 2025-09-29 cutover) | ||
| # TODO: use compat flag instead of compat date | ||
| from dataclasses import dataclass, field | ||
| from pathlib import Path | ||
|
|
||
| COMPAT_DATES: list[str] = ["2025-09-01", "2026-01-01"] | ||
|
|
||
| @dataclass(frozen=True) | ||
| class CompatConfig: | ||
| compat_date: str | ||
| python_version: str | ||
| extra_compat_flags: list[str] = field(default_factory=list) | ||
|
|
||
|
|
||
| COMPAT_CONFIGS: list[CompatConfig] = [ | ||
| CompatConfig( | ||
| compat_date="2025-09-01", | ||
| python_version="3.12", | ||
| extra_compat_flags=[ | ||
| "enable_python_external_sdk", | ||
| "python_process_pth_files", | ||
| "python_request_headers_preserve_commas", | ||
| ], | ||
| ), | ||
| CompatConfig( | ||
| compat_date="2026-01-01", | ||
| python_version="3.13", | ||
| extra_compat_flags=[ | ||
| "enable_python_external_sdk", | ||
| "python_process_pth_files", | ||
| "python_request_headers_preserve_commas", | ||
| ], | ||
| ), | ||
| CompatConfig( | ||
| compat_date="2026-07-01", | ||
| python_version="3.14", | ||
| # TODO: remove these when 3.14 is stable, and enabled by date | ||
| extra_compat_flags=["python_workers_20260610", "experimental"], | ||
| ), | ||
| ] | ||
|
|
||
|
|
||
| def replace_compat_date(file: Path, compat_date: str) -> None: | ||
| file.write_text(file.read_text().replace("%COMPAT_DATE", compat_date)) | ||
|
|
||
|
|
||
| def inject_compat_flags(file: Path, extra_flags: list[str]) -> None: | ||
| if not extra_flags: | ||
| return | ||
| content = file.read_text() | ||
| for flag in extra_flags: | ||
| content = content.replace('"python_workers"', f'"python_workers", "{flag}"') | ||
| file.write_text(content) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,10 @@ async def noop(*args): | |
|
|
||
| class Default(WorkerEntrypoint): | ||
| async def test(self): | ||
| if sys.version_info >= (3, 14): | ||
| # FIXME(soon): fix entropy patches for newer packages | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| return | ||
|
|
||
| os.chdir("/session/metadata/tests") | ||
| args = [".", "-vv"] | ||
| assert pytest.main(args) == 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.