Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: forbid unused crates in core #19

Merged
merged 5 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 3 additions & 82 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 8 additions & 16 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "marzano-core"
version = "0.2.0"
edition = "2021"

[lints]
rust.unused_crate_dependencies = "forbid"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
# todo remove all these since we should be interfacing through the language crate.
[dependencies]
Expand All @@ -20,34 +23,23 @@ tracing-opentelemetry = { version = "0.22.0", optional = true, default-features
regex = "1.7.3"
anyhow = "1.0.70"
tree-sitter-traversal = { version = "0.1.2", default-features = false }
lazy_static = "1.4.0"
itertools = "0.10.5"
im = "15.1.0"
serde_json = "1.0.96"
serde = { version = "1.0.164", features = ["derive"] }
debug_print = "1.0.0"
derive_builder = { version = "0.12.0", features = ["clippy"] }
similar = "2.2.1"
sha2 = "0.10.8"
elsa = "1.9.0"
reqwest = { version = "0.11.22", features = [
"blocking",
"json",
], optional = true }
futures = "0.3.29"
rayon = "1.8.0"
log = "0.4.20"
tiktoken-rs = "0.5.7"
rand = "0.8.5"
path-absolutize = { version = "3.1.1", optional = false, features = [
"use_unix_paths_on_wasm",
] }
getrandom = "0.2.11"
http = "0.2.11"
tokio = { version = "1.35.1", optional = true }
web-sys = { version = "0.3.66", features = ["console"], optional = true }
getrandom = {version = "0.2.11", optional = true }

[dev-dependencies]
similar = "2.2.1"
lazy_static = "1.4.0"
insta = { version = "1.30.0", features = ["yaml", "redactions"] }
trim-margin = "0.1.0"
marzano-auth = { path = "../auth" }
Expand All @@ -72,9 +64,9 @@ test_all = ["embeddings", "external_functions"]
grit_alpha = ["external_functions", "embeddings"]
# Shared network requests - common to all approaches
network_requests_common = ["marzano-util/network_requests_common"]
network_requests = ["reqwest", "tokio", "tokio/rt", "network_requests_common", "marzano-util/network_requests"]
network_requests = ["network_requests_common", "marzano-util/network_requests"]
network_requests_external = ["network_requests_common", "marzano-util/network_requests_external"]
wasm_core = ["getrandom/js", "web-sys", "network_requests_external", "external_functions_common", "external_functions_ffi", "marzano-util/external_functions_ffi"]
wasm_core = [ "dep:getrandom", "getrandom/js", "network_requests_external", "external_functions_common", "external_functions_ffi", "marzano-util/external_functions_ffi"]
grit_tracing = ["dep:tracing-opentelemetry"]
language-parsers = ["marzano-language/builtin-parser"]
grit-parser = ["tree-sitter-gritql"]
Expand Down
7 changes: 7 additions & 0 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ pub mod tree_sitter_serde;

#[cfg(test)]
mod test;

// getrandom is a deeply nested dependency used by many things eg. uuid
// to get wasm working we needed to enable a feature for this crate, so
// while we don't have a direct usage of it, we had to add it as a dependency
// and here we import it to avoid an unused dependency warning
#[cfg(target_arch = "wasm32")]
use getrandom as _;
Loading