From 00e0c4fddcd55e5b06b842e28b5bc9a14c41133e Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Sat, 4 Nov 2023 19:48:05 -0700 Subject: [PATCH] chore: add machete check to ensure no unused dependencies (#701) * refactor: remove useless dependencies * add machete --- .github/workflows/ci.yml | 3 +++ Cargo.lock | 5 ----- Cargo.toml | 1 - crates/llama-cpp-bindings/Cargo.toml | 1 - crates/tabby-scheduler/Cargo.toml | 2 -- crates/tabby/Cargo.toml | 2 -- 6 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15ff7b1..5275c7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,9 @@ jobs: - name: Cargo fmt run: cargo +nightly fmt --check + - name: Cargo Machete + uses: bnjbvr/cargo-machete@main + - run: bash ./ci/prepare_build_environment.sh - name: Run unit tests diff --git a/Cargo.lock b/Cargo.lock index c234bd6..0a1403c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2138,7 +2138,6 @@ dependencies = [ "futures", "tabby-inference", "tokio", - "tokio-util", ] [[package]] @@ -4062,7 +4061,6 @@ dependencies = [ "axum-streams", "axum-tracing-opentelemetry", "clap 4.4.7", - "futures", "http-api-bindings", "hyper", "lazy_static", @@ -4089,7 +4087,6 @@ dependencies = [ "textdistance", "thiserror", "tokio", - "tower", "tower-http 0.4.0", "tracing", "tracing-opentelemetry", @@ -4148,11 +4145,9 @@ version = "0.6.0-dev" dependencies = [ "anyhow", "file-rotate", - "filenamify", "ignore", "job_scheduler", "lazy_static", - "serde", "serde-jsonlines", "serde_json", "tabby-common", diff --git a/Cargo.toml b/Cargo.toml index 1904837..b701d96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,6 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1" serdeconv = "0.4.1" tokio = "1.28" -tokio-util = "0.7" tracing = "0.1" tracing-subscriber = "0.3" anyhow = "1.0.71" diff --git a/crates/llama-cpp-bindings/Cargo.toml b/crates/llama-cpp-bindings/Cargo.toml index 7acf31a..a61b4bc 100644 --- a/crates/llama-cpp-bindings/Cargo.toml +++ b/crates/llama-cpp-bindings/Cargo.toml @@ -16,6 +16,5 @@ async-trait = { workspace = true } tokio = { workspace = true, features = ["rt"] } tabby-inference = { path = "../tabby-inference" } derive_builder = { workspace = true } -tokio-util = { workspace = true } futures.workspace = true async-stream.workspace = true diff --git a/crates/tabby-scheduler/Cargo.toml b/crates/tabby-scheduler/Cargo.toml index df79ed6..59177fe 100644 --- a/crates/tabby-scheduler/Cargo.toml +++ b/crates/tabby-scheduler/Cargo.toml @@ -7,14 +7,12 @@ edition = "2021" [dependencies] anyhow = { workspace = true } -filenamify = "0.1.0" job_scheduler = "1.2.1" tabby-common = { path = "../tabby-common" } tantivy = { workspace = true } tracing = { workspace = true } tree-sitter-tags = "0.20.2" lazy_static = { workspace = true } -serde = { workspace = true } serde-jsonlines = { workspace = true } file-rotate = "0.7.5" tree-sitter-python = "0.20.2" diff --git a/crates/tabby/Cargo.toml b/crates/tabby/Cargo.toml index 4637e84..c1d08ed 100644 --- a/crates/tabby/Cargo.toml +++ b/crates/tabby/Cargo.toml @@ -14,7 +14,6 @@ tabby-inference = { path = "../tabby-inference" } axum = "0.6" hyper = { version = "0.14", features = ["full"] } tokio = { workspace = true, features = ["full"] } -tower = "0.4" utoipa = { version = "3.3", features = ["axum_extras", "preserve_order"] } utoipa-swagger-ui = { version = "3.1", features = ["axum"] } serde = { workspace = true } @@ -38,7 +37,6 @@ anyhow = { workspace = true } sysinfo = "0.29.8" nvml-wrapper = "0.9.0" http-api-bindings = { path = "../http-api-bindings" } -futures = { workspace = true } async-stream = { workspace = true } axum-streams = { version = "0.9.1", features = ["json"] } minijinja = { version = "1.0.8", features = ["loader"] }