diff --git a/Cargo.toml b/Cargo.toml index 3cdc471dc3d..9757ff0d5a3 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/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/pylib/Cargo.toml b/crates/pylib/Cargo.toml similarity index 100% rename from pylib/Cargo.toml rename to crates/pylib/Cargo.toml diff --git a/crates/pylib/Lib b/crates/pylib/Lib new file mode 120000 index 00000000000..5665252daf7 --- /dev/null +++ b/crates/pylib/Lib @@ -0,0 +1 @@ +../../Lib/ \ No newline at end of file diff --git a/pylib/build.rs b/crates/pylib/build.rs similarity index 80% rename from pylib/build.rs rename to crates/pylib/build.rs index f85c4b5cfb8..8885870e40f 100644 --- a/pylib/build.rs +++ b/crates/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/**/*"); } diff --git a/pylib/src/lib.rs b/crates/pylib/src/lib.rs similarity index 100% rename from pylib/src/lib.rs rename to crates/pylib/src/lib.rs diff --git a/example_projects/frozen_stdlib/Cargo.toml b/example_projects/frozen_stdlib/Cargo.toml index 78a88988d8a..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 = "../../pylib", default-features = false, features = ["freeze-stdlib"] } +rustpython-pylib = { path = "../../crates/pylib", default-features = false, features = ["freeze-stdlib"] } [workspace] diff --git a/pylib/Lib b/pylib/Lib deleted file mode 120000 index 47f928ff4d5..00000000000 --- a/pylib/Lib +++ /dev/null @@ -1 +0,0 @@ -../Lib \ No newline at end of file