From 49c512de8d9a6c61ee5bdf71d7367138f8376371 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Tue, 28 Oct 2025 13:04:41 +0200 Subject: [PATCH 1/7] Move `pylib` --- {pylib => crates/rustpython_pylib}/Cargo.toml | 0 {pylib => crates/rustpython_pylib}/Lib | 0 {pylib => crates/rustpython_pylib}/build.rs | 0 {pylib => crates/rustpython_pylib}/src/lib.rs | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {pylib => crates/rustpython_pylib}/Cargo.toml (100%) rename {pylib => crates/rustpython_pylib}/Lib (100%) rename {pylib => crates/rustpython_pylib}/build.rs (100%) rename {pylib => crates/rustpython_pylib}/src/lib.rs (100%) diff --git a/pylib/Cargo.toml b/crates/rustpython_pylib/Cargo.toml similarity index 100% rename from pylib/Cargo.toml rename to crates/rustpython_pylib/Cargo.toml diff --git a/pylib/Lib b/crates/rustpython_pylib/Lib similarity index 100% rename from pylib/Lib rename to crates/rustpython_pylib/Lib diff --git a/pylib/build.rs b/crates/rustpython_pylib/build.rs similarity index 100% rename from pylib/build.rs rename to crates/rustpython_pylib/build.rs diff --git a/pylib/src/lib.rs b/crates/rustpython_pylib/src/lib.rs similarity index 100% rename from pylib/src/lib.rs rename to crates/rustpython_pylib/src/lib.rs From 7201e152e8d37ec2aebbe89d3c22096a1fa79e96 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Tue, 28 Oct 2025 13:05:52 +0200 Subject: [PATCH 2/7] Fixed symlink --- crates/rustpython_pylib/Lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rustpython_pylib/Lib b/crates/rustpython_pylib/Lib index 47f928ff4d5..5665252daf7 120000 --- a/crates/rustpython_pylib/Lib +++ b/crates/rustpython_pylib/Lib @@ -1 +1 @@ -../Lib \ No newline at end of file +../../Lib/ \ No newline at end of file From 2422a15a24e08c4467cc60c26f9b1b24307bb625 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Tue, 28 Oct 2025 13:15:01 +0200 Subject: [PATCH 3/7] clean `build.rs` a bit --- crates/rustpython_pylib/build.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/rustpython_pylib/build.rs b/crates/rustpython_pylib/build.rs index f85c4b5cfb8..8885870e40f 100644 --- a/crates/rustpython_pylib/build.rs +++ b/crates/rustpython_pylib/build.rs @@ -1,10 +1,12 @@ +const CRATE_ROOT: &str = "../.."; + fn main() { - process_python_libs("../vm/Lib/python_builtins/*"); + process_python_libs(format!("{CRATE_ROOT}/vm/Lib/python_builtins/*").as_str()); + process_python_libs(format!("{CRATE_ROOT}/vm/Lib/core_modules/*").as_str()); - process_python_libs("../vm/Lib/core_modules/*"); #[cfg(feature = "freeze-stdlib")] if cfg!(windows) { - process_python_libs("../Lib/**/*"); + process_python_libs(format!("{CRATE_ROOT}/Lib/**/*").as_str()); } else { process_python_libs("./Lib/**/*"); } From 56ffbe3fa65a9db305064a97fd98edf2bfa9787b Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Tue, 28 Oct 2025 13:21:41 +0200 Subject: [PATCH 4/7] Modify `Cargo.toml` --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3cdc471dc3d..5e9ebfaddd0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -127,11 +127,11 @@ members = [ "jit", "vm", "vm/sre_engine", - "pylib", "stdlib", "derive-impl", "wtf8", "wasm/lib", + "crates/*", ] [workspace.package] @@ -152,7 +152,7 @@ rustpython-derive-impl = { path = "derive-impl", version = "0.4.0" } rustpython-jit = { path = "jit", version = "0.4.0" } rustpython-literal = { path = "compiler/literal", version = "0.4.0" } rustpython-vm = { path = "vm", default-features = false, version = "0.4.0" } -rustpython-pylib = { path = "pylib", version = "0.4.0" } +rustpython-pylib = { path = "crates/rustpython_pylib", version = "0.4.0" } rustpython-stdlib = { path = "stdlib", default-features = false, version = "0.4.0" } rustpython-sre_engine = { path = "vm/sre_engine", version = "0.4.0" } rustpython-wtf8 = { path = "wtf8", version = "0.4.0" } From 3efaeb9ec91276a5ae6aca6f427ebdd20bffd9d2 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 1 Nov 2025 13:39:26 +0200 Subject: [PATCH 5/7] fix path for example project --- example_projects/frozen_stdlib/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_projects/frozen_stdlib/Cargo.toml b/example_projects/frozen_stdlib/Cargo.toml index 78a88988d8a..21cc1de98d6 100644 --- a/example_projects/frozen_stdlib/Cargo.toml +++ b/example_projects/frozen_stdlib/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] rustpython = { path = "../../", default-features = false, features = ["freeze-stdlib"] } rustpython-vm = { path = "../../vm", default-features = false, features = ["freeze-stdlib"] } -rustpython-pylib = { path = "../../pylib", default-features = false, features = ["freeze-stdlib"] } +rustpython-pylib = { path = "../../crates/rustpython_pylib", default-features = false, features = ["freeze-stdlib"] } [workspace] From cdbeccbecda5da0624919cd223f40c03984bc410 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Fri, 14 Nov 2025 11:16:08 +0200 Subject: [PATCH 6/7] Rename to `crates/pylib` --- Cargo.toml | 2 +- crates/{rustpython_pylib => pylib}/Cargo.toml | 0 crates/{rustpython_pylib => pylib}/Lib | 0 crates/{rustpython_pylib => pylib}/build.rs | 0 crates/{rustpython_pylib => pylib}/src/lib.rs | 0 5 files changed, 1 insertion(+), 1 deletion(-) rename crates/{rustpython_pylib => pylib}/Cargo.toml (100%) rename crates/{rustpython_pylib => pylib}/Lib (100%) rename crates/{rustpython_pylib => pylib}/build.rs (100%) rename crates/{rustpython_pylib => pylib}/src/lib.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 5e9ebfaddd0..9757ff0d5a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -152,7 +152,7 @@ rustpython-derive-impl = { path = "derive-impl", version = "0.4.0" } rustpython-jit = { path = "jit", version = "0.4.0" } rustpython-literal = { path = "compiler/literal", version = "0.4.0" } rustpython-vm = { path = "vm", default-features = false, version = "0.4.0" } -rustpython-pylib = { path = "crates/rustpython_pylib", version = "0.4.0" } +rustpython-pylib = { path = "crates/pylib", version = "0.4.0" } rustpython-stdlib = { path = "stdlib", default-features = false, version = "0.4.0" } rustpython-sre_engine = { path = "vm/sre_engine", version = "0.4.0" } rustpython-wtf8 = { path = "wtf8", version = "0.4.0" } diff --git a/crates/rustpython_pylib/Cargo.toml b/crates/pylib/Cargo.toml similarity index 100% rename from crates/rustpython_pylib/Cargo.toml rename to crates/pylib/Cargo.toml diff --git a/crates/rustpython_pylib/Lib b/crates/pylib/Lib similarity index 100% rename from crates/rustpython_pylib/Lib rename to crates/pylib/Lib diff --git a/crates/rustpython_pylib/build.rs b/crates/pylib/build.rs similarity index 100% rename from crates/rustpython_pylib/build.rs rename to crates/pylib/build.rs diff --git a/crates/rustpython_pylib/src/lib.rs b/crates/pylib/src/lib.rs similarity index 100% rename from crates/rustpython_pylib/src/lib.rs rename to crates/pylib/src/lib.rs From a3c670b4864c4a8b00cc847d4a26bc34cd8106d1 Mon Sep 17 00:00:00 2001 From: "Jeong, YunWon" <69878+youknowone@users.noreply.github.com> Date: Fri, 14 Nov 2025 23:18:56 +0900 Subject: [PATCH 7/7] Fix example_projects --- example_projects/frozen_stdlib/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_projects/frozen_stdlib/Cargo.toml b/example_projects/frozen_stdlib/Cargo.toml index 21cc1de98d6..6824865cbf7 100644 --- a/example_projects/frozen_stdlib/Cargo.toml +++ b/example_projects/frozen_stdlib/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] rustpython = { path = "../../", default-features = false, features = ["freeze-stdlib"] } rustpython-vm = { path = "../../vm", default-features = false, features = ["freeze-stdlib"] } -rustpython-pylib = { path = "../../crates/rustpython_pylib", default-features = false, features = ["freeze-stdlib"] } +rustpython-pylib = { path = "../../crates/pylib", default-features = false, features = ["freeze-stdlib"] } [workspace]