diff --git a/Cargo.lock b/Cargo.lock index 38aad89fe..46c7135d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -237,6 +237,12 @@ version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bzip2" version = "0.5.2" @@ -630,6 +636,21 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" version = "1.4.2" @@ -1396,6 +1417,16 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "lzma-rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" +dependencies = [ + "byteorder", + "crc", +] + [[package]] name = "mac_address" version = "1.1.8" @@ -2467,6 +2498,7 @@ dependencies = [ "libc", "libsqlite3-sys", "libz-rs-sys", + "lzma-rs", "mac_address", "malachite-bigint", "md-5", diff --git a/stdlib/Cargo.toml b/stdlib/Cargo.toml index 8fcaaa24d..70f70b855 100644 --- a/stdlib/Cargo.toml +++ b/stdlib/Cargo.toml @@ -80,6 +80,7 @@ crc32fast = "1.3.2" flate2 = { version = "1.1", default-features = false, features = ["zlib-rs"] } libz-sys = { package = "libz-rs-sys", version = "0.5" } bzip2 = { version = "0.5", features = ["libbz2-rs-sys"] } +lzma-rs = "0.3" # tkinter tk-sys = { git = "https://github.com/arihant2math/tkinter.git", tag = "v0.2.0", optional = true } diff --git a/stdlib/src/lib.rs b/stdlib/src/lib.rs index 7b3124c50..e8ba5570d 100644 --- a/stdlib/src/lib.rs +++ b/stdlib/src/lib.rs @@ -83,6 +83,7 @@ mod uuid; #[cfg(feature = "tkinter")] mod tkinter; +mod lzma; use rustpython_common as common; use rustpython_vm as vm; @@ -120,6 +121,7 @@ pub fn get_module_inits() -> impl Iterator, StdlibInit "faulthandler" => faulthandler::make_module, "gc" => gc::make_module, "_hashlib" => hashlib::make_module, + "_lzma" => lzma::make_module, "_sha1" => sha1::make_module, "_sha3" => sha3::make_module, "_sha256" => sha256::make_module, diff --git a/stdlib/src/lzma.rs b/stdlib/src/lzma.rs new file mode 100644 index 000000000..d80449621 --- /dev/null +++ b/stdlib/src/lzma.rs @@ -0,0 +1,6 @@ +pub(crate) use _lzma::make_module; + +#[pymodule] +mod _lzma { + +} \ No newline at end of file