Skip to content

Commit cfc9db9

Browse files
committed
Align compiler and AST behavior with CPython
Update the compiler pipeline, AST module support, and related VM compile/eval paths toward CPython 3.14 behavior. Use upstream Ruff parser crates directly and keep RustPython-specific syntax preflight handling in the compile path. Refresh opcode metadata, snapshots, and targeted tests for the aligned bytecode and AST behavior.
1 parent 55b96f9 commit cfc9db9

75 files changed

Lines changed: 25020 additions & 6142 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cspell.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@
6666
"deoptimize",
6767
"emscripten",
6868
"excs",
69+
"flufl",
6970
"fnfe",
71+
"fsdefault",
7072
"ifexp",
73+
"implicits",
7174
"interps",
7275
"jitted",
7376
"jitting",

.pre-commit-config.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ repos:
1616
priority: 0
1717

1818
- id: ruff-check
19-
args: [--select, I, --fix, --exit-non-zero-on-fix]
19+
args:
20+
[
21+
--select,
22+
I,
23+
--fix,
24+
--exit-non-zero-on-fix,
25+
--config,
26+
"lint.isort.known-first-party = ['cpython', 'opcodes', 'utils']",
27+
]
2028
types_or: [python]
2129
require_serial: true
2230
priority: 1

Cargo.lock

Lines changed: 100 additions & 94 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,19 +183,10 @@ rustpython-sre_engine = { path = "crates/sre_engine", version = "0.5.0" }
183183
rustpython-wtf8 = { path = "crates/wtf8", version = "0.5.0" }
184184
rustpython-doc = { path = "crates/doc", version = "0.5.0" }
185185

186-
# Use RustPython-packaged Ruff crates from the published fork while keeping
187-
# existing crate names in the codebase.
188-
ruff_python_parser = { package = "rustpython-ruff_python_parser", version = "0.15.8" }
189-
ruff_python_ast = { package = "rustpython-ruff_python_ast", version = "0.15.8" }
190-
ruff_text_size = { package = "rustpython-ruff_text_size", version = "0.15.8" }
191-
ruff_source_file = { package = "rustpython-ruff_source_file", version = "0.15.8" }
192-
# To update ruff crates, comment out the above lines and uncomment the following lines to pull directly from the Ruff repository at the specified commit hash.
193-
# Ruff tag 0.15.8 is based on commit c2a8815842f9dc5d24ec19385eae0f1a7188b0d9
194-
# at the time of this capture. We use the commit hash to ensure reproducible builds.
195-
# ruff_python_parser = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" }
196-
# ruff_python_ast = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" }
197-
# ruff_text_size = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" }
198-
# ruff_source_file = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" }
186+
ruff_python_parser = { git = "https://github.com/astral-sh/ruff.git", rev = "6686f63404207bfdffe8ab0acb25da72c3432190" }
187+
ruff_python_ast = { git = "https://github.com/astral-sh/ruff.git", rev = "6686f63404207bfdffe8ab0acb25da72c3432190" }
188+
ruff_text_size = { git = "https://github.com/astral-sh/ruff.git", rev = "6686f63404207bfdffe8ab0acb25da72c3432190" }
189+
ruff_source_file = { git = "https://github.com/astral-sh/ruff.git", rev = "6686f63404207bfdffe8ab0acb25da72c3432190" }
199190

200191
der = { version = "0.8", features = ["alloc", "oid", "pem", "zeroize"] }
201192
phf = { version = "0.13.1", default-features = false, features = ["macros"]}
@@ -311,6 +302,7 @@ tcl-sys = { git = "https://github.com/arihant2math/tkinter.git", tag = "v0.2.0"
311302
textwrap = { version = "0.16.2", default-features = false }
312303
termios = "0.3.3"
313304
thiserror = "2.0"
305+
thin-vec = "0.2.14"
314306
timsort = "0.1.2"
315307
tk-sys = { git = "https://github.com/arihant2math/tkinter.git", tag = "v0.2.0" }
316308
icu_casemap = "2"

0 commit comments

Comments
 (0)