diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d2373dd03db..258309b519b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -557,3 +557,17 @@ jobs: run: wasmer run --dir $(pwd) target/wasm32-wasip1/release/rustpython.wasm -- "$(pwd)/extra_tests/snippets/stdlib_random.py" - name: run cpython unittest run: wasmer run --dir $(pwd) target/wasm32-wasip1/release/rustpython.wasm -- "$(pwd)/Lib/test/test_int.py" + + cargo-shear: + name: cargo shear + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - uses: cargo-bins/cargo-binstall@1800853f2578f8c34492ec76154caef8e163fbca # v1.17.7 + + - run: cargo binstall --no-confirm cargo-shear + + - run: cargo shear diff --git a/Cargo.lock b/Cargo.lock index e7d738c7c55..532cb7204b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3299,7 +3299,6 @@ dependencies = [ "mt19937", "nix 0.30.1", "num-complex", - "num-integer", "num-traits", "num_enum", "oid-registry", @@ -3342,9 +3341,7 @@ dependencies = [ "unic-ucd-age", "unic-ucd-bidi", "unic-ucd-category", - "unic-ucd-ident", "unicode-bidi-mirroring", - "unicode-casing", "unicode_names2 2.0.0", "uuid", "webpki-roots", @@ -3358,9 +3355,6 @@ dependencies = [ [[package]] name = "rustpython-venvlauncher" version = "0.5.0" -dependencies = [ - "windows-sys 0.61.2", -] [[package]] name = "rustpython-vm" @@ -3424,7 +3418,6 @@ dependencies = [ "strum", "strum_macros", "thiserror 2.0.18", - "thread_local", "timsort", "uname", "unic-ucd-bidi", @@ -3453,7 +3446,6 @@ version = "0.5.0" dependencies = [ "console_error_panic_hook", "js-sys", - "ruff_python_parser", "rustpython-common", "rustpython-pylib", "rustpython-stdlib", @@ -3944,15 +3936,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "thread_local" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" -dependencies = [ - "cfg-if", -] - [[package]] name = "time" version = "0.3.47" diff --git a/Cargo.toml b/Cargo.toml index c62ddaf9e6b..8debf3ca321 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,6 @@ rustpython-compiler = { workspace = true } rustpython-pylib = { workspace = true, optional = true } rustpython-stdlib = { workspace = true, optional = true, features = ["compiler"] } rustpython-vm = { workspace = true, features = ["compiler", "gc"] } -ruff_python_parser = { workspace = true } cfg-if = { workspace = true } log = { workspace = true } @@ -56,6 +55,7 @@ rustyline = { workspace = true } criterion = { workspace = true } pyo3 = { version = "0.28.2", features = ["auto-initialize"] } rustpython-stdlib = { workspace = true } +ruff_python_parser = { workspace = true } [[bench]] name = "execution" @@ -169,7 +169,6 @@ ascii = "1.1" bitflags = "2.11.0" bitflagset = "0.0.3" bstr = "1" -bytes = "1.11.1" cfg-if = "1.0" chrono = { version = "0.4.44", default-features = false, features = ["clock", "oldtime", "std"] } constant_time_eq = "0.4" @@ -216,7 +215,6 @@ strum = "0.27" strum_macros = "0.28" syn = "2" thiserror = "2.0" -thread_local = "1.1.9" unicode-casing = "0.1.1" unic-char-property = "0.9.0" unic-normal = "0.9.0" diff --git a/crates/stdlib/Cargo.toml b/crates/stdlib/Cargo.toml index 4942467b586..02f122596f6 100644 --- a/crates/stdlib/Cargo.toml +++ b/crates/stdlib/Cargo.toml @@ -48,7 +48,6 @@ libc = { workspace = true } nix = { workspace = true } num-complex = { workspace = true } malachite-bigint = { workspace = true } -num-integer = { workspace = true } num-traits = { workspace = true } num_enum = { workspace = true } parking_lot = { workspace = true } @@ -78,16 +77,12 @@ constant_time_eq = { workspace = true } ## unicode stuff unicode_names2 = { workspace = true } -# TODO: use unic for this; needed for title case: -# https://github.com/RustPython/RustPython/pull/832#discussion_r275428939 -unicode-casing = { workspace = true } # update version all at the same time unic-char-property = { workspace = true } unic-normal = { workspace = true } unic-ucd-bidi = { workspace = true } unic-ucd-category = { workspace = true } unic-ucd-age = { workspace = true } -unic-ucd-ident = { workspace = true } ucd = "0.1.1" unicode-bidi-mirroring = { workspace = true } diff --git a/crates/venvlauncher/Cargo.toml b/crates/venvlauncher/Cargo.toml index ac3ea106b7a..c88dc5d356b 100644 --- a/crates/venvlauncher/Cargo.toml +++ b/crates/venvlauncher/Cargo.toml @@ -13,15 +13,5 @@ license.workspace = true name = "venvlaunchert" path = "src/main.rs" -[target.'cfg(windows)'.dependencies] -windows-sys = { workspace = true, features = [ - "Win32_Foundation", - "Win32_System_Threading", - "Win32_System_Environment", - "Win32_Storage_FileSystem", - "Win32_System_Console", - "Win32_Security", -] } - [lints] workspace = true diff --git a/crates/vm/Cargo.toml b/crates/vm/Cargo.toml index 5f7e901b834..8a684c93dd9 100644 --- a/crates/vm/Cargo.toml +++ b/crates/vm/Cargo.toml @@ -72,7 +72,6 @@ static_assertions = { workspace = true } strum = { workspace = true } strum_macros = { workspace = true } thiserror = { workspace = true } -thread_local = { workspace = true } memchr = { workspace = true } caseless = "0.2.2" diff --git a/crates/vm/src/builtins/int.rs b/crates/vm/src/builtins/int.rs index e42391acd61..0ae1c6d8654 100644 --- a/crates/vm/src/builtins/int.rs +++ b/crates/vm/src/builtins/int.rs @@ -24,7 +24,7 @@ use core::cell::Cell; use core::ops::{Neg, Not}; use core::ptr::NonNull; use malachite_bigint::{BigInt, Sign}; -use num_integer::Integer; +use num_integer::{ExtendedGcd, Integer}; use num_traits::{One, Pow, PrimInt, Signed, ToPrimitive, Zero}; #[pyclass(module = false, name = "int")] @@ -414,7 +414,6 @@ impl PyInt { if a.is_negative() { a + n } else { a } } fn inverse(a: BigInt, n: &BigInt) -> Option { - use num_integer::*; let ExtendedGcd { gcd, x: c, .. } = a.extended_gcd(n); if gcd.is_one() { Some(normalize(c, n)) diff --git a/crates/wasm/Cargo.toml b/crates/wasm/Cargo.toml index a2bb1a9f948..a285dcabda9 100644 --- a/crates/wasm/Cargo.toml +++ b/crates/wasm/Cargo.toml @@ -23,8 +23,6 @@ rustpython-stdlib = { workspace = true, default-features = false, optional = tru # make sure no threading! otherwise wasm build will fail rustpython-vm = { workspace = true, features = ["compiler", "encodings", "serde", "wasmbind"] } -ruff_python_parser = { workspace = true } - serde = { workspace = true } wasm-bindgen = { workspace = true } @@ -48,3 +46,6 @@ wasm-opt = false#["-O1"] [lints] workspace = true + +[package.metadata.cargo-shear] +ignored = ["serde", "rustpython-common"]