X Tutup
Skip to content

Commit 68cf736

Browse files
authored
Add cargo shear CI step (#7461)
* Add `cargo shear` CI step * Remove some deps * Move `ruff_python_parser` to dev deps * Remove `thread_local` crate * Cleanup `num-integer` usage * Remove parser fro. wasm * Remove windows-sys from venv launcher * Update lock * Resolve more * Fix wasm * Update lock
1 parent 53fa525 commit 68cf736

File tree

8 files changed

+19
-40
lines changed

8 files changed

+19
-40
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,3 +557,17 @@ jobs:
557557
run: wasmer run --dir $(pwd) target/wasm32-wasip1/release/rustpython.wasm -- "$(pwd)/extra_tests/snippets/stdlib_random.py"
558558
- name: run cpython unittest
559559
run: wasmer run --dir $(pwd) target/wasm32-wasip1/release/rustpython.wasm -- "$(pwd)/Lib/test/test_int.py"
560+
561+
cargo-shear:
562+
name: cargo shear
563+
runs-on: ubuntu-latest
564+
steps:
565+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
566+
with:
567+
persist-credentials: false
568+
569+
- uses: cargo-bins/cargo-binstall@1800853f2578f8c34492ec76154caef8e163fbca # v1.17.7
570+
571+
- run: cargo binstall --no-confirm cargo-shear
572+
573+
- run: cargo shear

Cargo.lock

Lines changed: 0 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ rustpython-compiler = { workspace = true }
3535
rustpython-pylib = { workspace = true, optional = true }
3636
rustpython-stdlib = { workspace = true, optional = true, features = ["compiler"] }
3737
rustpython-vm = { workspace = true, features = ["compiler", "gc"] }
38-
ruff_python_parser = { workspace = true }
3938

4039
cfg-if = { workspace = true }
4140
log = { workspace = true }
@@ -56,6 +55,7 @@ rustyline = { workspace = true }
5655
criterion = { workspace = true }
5756
pyo3 = { version = "0.28.2", features = ["auto-initialize"] }
5857
rustpython-stdlib = { workspace = true }
58+
ruff_python_parser = { workspace = true }
5959

6060
[[bench]]
6161
name = "execution"
@@ -169,7 +169,6 @@ ascii = "1.1"
169169
bitflags = "2.11.0"
170170
bitflagset = "0.0.3"
171171
bstr = "1"
172-
bytes = "1.11.1"
173172
cfg-if = "1.0"
174173
chrono = { version = "0.4.44", default-features = false, features = ["clock", "oldtime", "std"] }
175174
constant_time_eq = "0.4"
@@ -216,7 +215,6 @@ strum = "0.27"
216215
strum_macros = "0.28"
217216
syn = "2"
218217
thiserror = "2.0"
219-
thread_local = "1.1.9"
220218
unicode-casing = "0.1.1"
221219
unic-char-property = "0.9.0"
222220
unic-normal = "0.9.0"

crates/stdlib/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ libc = { workspace = true }
4848
nix = { workspace = true }
4949
num-complex = { workspace = true }
5050
malachite-bigint = { workspace = true }
51-
num-integer = { workspace = true }
5251
num-traits = { workspace = true }
5352
num_enum = { workspace = true }
5453
parking_lot = { workspace = true }
@@ -78,16 +77,12 @@ constant_time_eq = { workspace = true }
7877

7978
## unicode stuff
8079
unicode_names2 = { workspace = true }
81-
# TODO: use unic for this; needed for title case:
82-
# https://github.com/RustPython/RustPython/pull/832#discussion_r275428939
83-
unicode-casing = { workspace = true }
8480
# update version all at the same time
8581
unic-char-property = { workspace = true }
8682
unic-normal = { workspace = true }
8783
unic-ucd-bidi = { workspace = true }
8884
unic-ucd-category = { workspace = true }
8985
unic-ucd-age = { workspace = true }
90-
unic-ucd-ident = { workspace = true }
9186
ucd = "0.1.1"
9287
unicode-bidi-mirroring = { workspace = true }
9388

crates/venvlauncher/Cargo.toml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,5 @@ license.workspace = true
1313
name = "venvlaunchert"
1414
path = "src/main.rs"
1515

16-
[target.'cfg(windows)'.dependencies]
17-
windows-sys = { workspace = true, features = [
18-
"Win32_Foundation",
19-
"Win32_System_Threading",
20-
"Win32_System_Environment",
21-
"Win32_Storage_FileSystem",
22-
"Win32_System_Console",
23-
"Win32_Security",
24-
] }
25-
2616
[lints]
2717
workspace = true

crates/vm/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ static_assertions = { workspace = true }
7272
strum = { workspace = true }
7373
strum_macros = { workspace = true }
7474
thiserror = { workspace = true }
75-
thread_local = { workspace = true }
7675
memchr = { workspace = true }
7776

7877
caseless = "0.2.2"

crates/vm/src/builtins/int.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use core::cell::Cell;
2424
use core::ops::{Neg, Not};
2525
use core::ptr::NonNull;
2626
use malachite_bigint::{BigInt, Sign};
27-
use num_integer::Integer;
27+
use num_integer::{ExtendedGcd, Integer};
2828
use num_traits::{One, Pow, PrimInt, Signed, ToPrimitive, Zero};
2929

3030
#[pyclass(module = false, name = "int")]
@@ -414,7 +414,6 @@ impl PyInt {
414414
if a.is_negative() { a + n } else { a }
415415
}
416416
fn inverse(a: BigInt, n: &BigInt) -> Option<BigInt> {
417-
use num_integer::*;
418417
let ExtendedGcd { gcd, x: c, .. } = a.extended_gcd(n);
419418
if gcd.is_one() {
420419
Some(normalize(c, n))

crates/wasm/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ rustpython-stdlib = { workspace = true, default-features = false, optional = tru
2323
# make sure no threading! otherwise wasm build will fail
2424
rustpython-vm = { workspace = true, features = ["compiler", "encodings", "serde", "wasmbind"] }
2525

26-
ruff_python_parser = { workspace = true }
27-
2826
serde = { workspace = true }
2927
wasm-bindgen = { workspace = true }
3028

@@ -48,3 +46,6 @@ wasm-opt = false#["-O1"]
4846

4947
[lints]
5048
workspace = true
49+
50+
[package.metadata.cargo-shear]
51+
ignored = ["serde", "rustpython-common"]

0 commit comments

Comments
 (0)
X Tutup