Skip to content

Commit

Permalink
tests: Remove unused dependencies (#1043)
Browse files Browse the repository at this point in the history
* tests: Remove unused dependencies

Found these unused dependencies using: `cargo +nightly udeps && cargo +nightly udeps --all-targets`

* ci: Add cargo-udeps
  • Loading branch information
caspermeijn committed May 3, 2024
1 parent 680a2e1 commit 71b8e8e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -59,6 +59,26 @@ jobs:
- name: Check unused dependencies
run: cargo machete

unused_dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: dtolnay/rust-toolchain@nightly
- name: install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: install ninja
uses: ./.github/actions/setup-ninja
- name: install cargo-udeps
uses: taiki-e/install-action@cargo-udeps
- name: cargo udeps
run: cargo +nightly udeps
- name: cargo udeps all-targets
run: cargo +nightly udeps --all-targets

test:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
1 change: 0 additions & 1 deletion fuzz/Cargo.toml
Expand Up @@ -13,7 +13,6 @@ cargo-fuzz = true

[dependencies]
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }
protobuf = { path = "../protobuf" }
tests = { path = "../tests" }

[[bin]]
Expand Down
2 changes: 0 additions & 2 deletions prost/Cargo.toml
Expand Up @@ -34,8 +34,6 @@ prost-derive = { version = "0.12.4", path = "../prost-derive", optional = true }

[dev-dependencies]
criterion = { version = "0.4", default-features = false }
env_logger = { version = "0.10", default-features = false }
log = "0.4"
proptest = "1"
rand = "0.8"

Expand Down
3 changes: 0 additions & 3 deletions tests-2015/Cargo.toml
Expand Up @@ -21,19 +21,16 @@ std = []

[dependencies]
anyhow = "1.0.1"
bytes = "1"
cfg-if = "1"
prost = { path = "../prost" }
prost-types = { path = "../prost-types" }
protobuf = { path = "../protobuf" }

[dev-dependencies]
diff = "0.1"
prost-build = { path = "../prost-build" }
tempfile = "3"

[build-dependencies]
cfg-if = "1"
env_logger = { version = "0.10", default-features = false }
prost-build = { path = "../prost-build" }
protobuf = { path = "../protobuf" }
5 changes: 1 addition & 4 deletions tests-no-std/Cargo.toml
Expand Up @@ -22,19 +22,16 @@ path = "../tests/src/lib.rs"

[dependencies]
anyhow = { version = "1.0.45", default-features = false }
bytes = { version = "1", default-features = false }
cfg-if = "1"
prost = { path = "../prost", default-features = false, features = ["derive"] }
prost-types = { path = "../prost-types", default-features = false }
protobuf = { path = "../protobuf" }

[dev-dependencies]
diff = "0.1"
prost-build = { path = "../prost-build" }
tempfile = "3"
protobuf = { path = "../protobuf" }

[build-dependencies]
cfg-if = "1"
env_logger = { version = "0.10", default-features = false }
prost-build = { path = "../prost-build" }
protobuf = { path = "../protobuf" }
5 changes: 1 addition & 4 deletions tests/Cargo.toml
Expand Up @@ -16,19 +16,16 @@ std = []

[dependencies]
anyhow = "1.0.1"
# bytes = "1"
cfg-if = "1"
prost = { path = "../prost" }
prost-types = { path = "../prost-types" }
protobuf = { path = "../protobuf" }

[dev-dependencies]
diff = "0.1"
prost-build = { path = "../prost-build", features = ["cleanup-markdown"] }
tempfile = "3"
protobuf = { path = "../protobuf" }

[build-dependencies]
cfg-if = "1"
env_logger = { version = "0.10", default-features = false }
prost-build = { path = "../prost-build" }
protobuf = { path = "../protobuf" }
1 change: 0 additions & 1 deletion tests/src/lib.rs
Expand Up @@ -13,7 +13,6 @@ extern crate alloc;
cfg_if! {
if #[cfg(feature = "edition-2015")] {
extern crate anyhow;
extern crate bytes;
extern crate core;
extern crate prost;
extern crate prost_types;
Expand Down

0 comments on commit 71b8e8e

Please sign in to comment.