From b03a027d794ed44b6a4a9f71ad3e37fb23941840 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 14 Mar 2026 09:40:39 +0100 Subject: [PATCH 1/2] Update ruff to `0.15.6` --- Cargo.lock | 10 +++++----- Cargo.toml | 10 +++++----- crates/stdlib/src/_tokenize.rs | 1 + crates/vm/src/stdlib/_ast/statement.rs | 6 ++++++ 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68adc9d682c..a6ee86fc534 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2894,7 +2894,7 @@ dependencies = [ [[package]] name = "ruff_python_ast" version = "0.0.0" -source = "git+https://github.com/astral-sh/ruff.git?rev=5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be#5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" +source = "git+https://github.com/astral-sh/ruff.git?rev=e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675#e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" dependencies = [ "aho-corasick", "bitflags 2.11.0", @@ -2912,7 +2912,7 @@ dependencies = [ [[package]] name = "ruff_python_parser" version = "0.0.0" -source = "git+https://github.com/astral-sh/ruff.git?rev=5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be#5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" +source = "git+https://github.com/astral-sh/ruff.git?rev=e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675#e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" dependencies = [ "bitflags 2.11.0", "bstr", @@ -2932,7 +2932,7 @@ dependencies = [ [[package]] name = "ruff_python_trivia" version = "0.0.0" -source = "git+https://github.com/astral-sh/ruff.git?rev=5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be#5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" +source = "git+https://github.com/astral-sh/ruff.git?rev=e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675#e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" dependencies = [ "itertools 0.14.0", "ruff_source_file", @@ -2943,7 +2943,7 @@ dependencies = [ [[package]] name = "ruff_source_file" version = "0.0.0" -source = "git+https://github.com/astral-sh/ruff.git?rev=5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be#5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" +source = "git+https://github.com/astral-sh/ruff.git?rev=e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675#e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" dependencies = [ "memchr", "ruff_text_size", @@ -2952,7 +2952,7 @@ dependencies = [ [[package]] name = "ruff_text_size" version = "0.0.0" -source = "git+https://github.com/astral-sh/ruff.git?rev=5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be#5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" +source = "git+https://github.com/astral-sh/ruff.git?rev=e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675#e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" dependencies = [ "get-size2", ] diff --git a/Cargo.toml b/Cargo.toml index 2f720de968a..1fd20d19ccc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -156,12 +156,12 @@ rustpython-sre_engine = { path = "crates/sre_engine", version = "0.4.0" } rustpython-wtf8 = { path = "crates/wtf8", version = "0.4.0" } rustpython-doc = { path = "crates/doc", version = "0.4.0" } -# Ruff tag 0.15.5 is based on commit 5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be +# Ruff tag 0.15.6 is based on commit e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675 # at the time of this capture. We use the commit hash to ensure reproducible builds. -ruff_python_parser = { git = "https://github.com/astral-sh/ruff.git", rev = "5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" } -ruff_python_ast = { git = "https://github.com/astral-sh/ruff.git", rev = "5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" } -ruff_text_size = { git = "https://github.com/astral-sh/ruff.git", rev = "5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" } -ruff_source_file = { git = "https://github.com/astral-sh/ruff.git", rev = "5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" } +ruff_python_parser = { git = "https://github.com/astral-sh/ruff.git", rev = "e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" } +ruff_python_ast = { git = "https://github.com/astral-sh/ruff.git", rev = "e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" } +ruff_text_size = { git = "https://github.com/astral-sh/ruff.git", rev = "e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" } +ruff_source_file = { git = "https://github.com/astral-sh/ruff.git", rev = "e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" } phf = { version = "0.13.1", default-features = false, features = ["macros"]} ahash = "0.8.12" diff --git a/crates/stdlib/src/_tokenize.rs b/crates/stdlib/src/_tokenize.rs index 8219ac61650..13bd1661305 100644 --- a/crates/stdlib/src/_tokenize.rs +++ b/crates/stdlib/src/_tokenize.rs @@ -750,6 +750,7 @@ mod _tokenize { TokenKind::TStringMiddle => 63, TokenKind::TStringEnd => 64, TokenKind::IpyEscapeCommand | TokenKind::Question | TokenKind::Unknown => 67, // ERRORTOKEN + TokenKind::Lazy => u8::MAX, // Placeholder: RustPython Doesn't support `lazy imports` yet } } } diff --git a/crates/vm/src/stdlib/_ast/statement.rs b/crates/vm/src/stdlib/_ast/statement.rs index cda34da40a3..4c53bf01877 100644 --- a/crates/vm/src/stdlib/_ast/statement.rs +++ b/crates/vm/src/stdlib/_ast/statement.rs @@ -1043,6 +1043,7 @@ impl Node for ast::StmtImport { node_index: _, names, range: _range, + is_lazy: _, } = self; let node = NodeAst .into_ref_with_type(_vm, pyast::NodeStmtImport::static_type().to_owned()) @@ -1053,6 +1054,7 @@ impl Node for ast::StmtImport { node_add_location(&dict, _range, _vm, source_file); node.into() } + fn ast_from_object( _vm: &VirtualMachine, source_file: &SourceFile, @@ -1066,6 +1068,7 @@ impl Node for ast::StmtImport { get_node_field(_vm, &_object, "names", "Import")?, )?, range: range_from_object(_vm, source_file, _object, "Import")?, + is_lazy: false, // Placeholder }) } } @@ -1078,6 +1081,7 @@ impl Node for ast::StmtImportFrom { names, level, range, + is_lazy: _, } = self; let node = NodeAst .into_ref_with_type(vm, pyast::NodeStmtImportFrom::static_type().to_owned()) @@ -1092,6 +1096,7 @@ impl Node for ast::StmtImportFrom { node_add_location(&dict, range, vm, source_file); node.into() } + fn ast_from_object( vm: &VirtualMachine, source_file: &SourceFile, @@ -1120,6 +1125,7 @@ impl Node for ast::StmtImportFrom { .transpose()? .unwrap_or(0), range: range_from_object(vm, source_file, _object, "ImportFrom")?, + is_lazy: false, // Placeholder }) } } From 78809422ff50789f1af04113e6148e92052e42ab Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 14 Mar 2026 10:04:09 +0100 Subject: [PATCH 2/2] Unmark passing tests --- Lib/test/test_unpack_ex.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_unpack_ex.py b/Lib/test/test_unpack_ex.py index 1496e3be93f..13b789f52dc 100644 --- a/Lib/test/test_unpack_ex.py +++ b/Lib/test/test_unpack_ex.py @@ -148,27 +148,27 @@ [0, 1, 2, 3, 4] >>> l = [a, (3, 4), {5}, {6: None}, (i for i in range(7, 10))] - >>> [*item for item in l] # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE + >>> [*item for item in l] Traceback (most recent call last): ... SyntaxError: iterable unpacking cannot be used in comprehension - >>> [*[0, 1] for i in range(10)] # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE + >>> [*[0, 1] for i in range(10)] Traceback (most recent call last): ... SyntaxError: iterable unpacking cannot be used in comprehension - >>> [*'a' for i in range(10)] # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE + >>> [*'a' for i in range(10)] Traceback (most recent call last): ... SyntaxError: iterable unpacking cannot be used in comprehension - >>> [*[] for i in range(10)] # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE + >>> [*[] for i in range(10)] Traceback (most recent call last): ... SyntaxError: iterable unpacking cannot be used in comprehension - >>> {**{} for a in [1]} # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE + >>> {**{} for a in [1]} # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE Traceback (most recent call last): ... SyntaxError: dict unpacking cannot be used in dict comprehension