Skip to content

Commit

Permalink
chore: bump dependencies and remove unused ones (#771)
Browse files Browse the repository at this point in the history
Bumps a few dependencies to reduce duplicates (especially itertools) and
removes unused dependencies.
  • Loading branch information
baszalmstra authored Jul 8, 2024
1 parent 412be3e commit 09a0ba9
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 85 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ clap = { version = "4.5.4", features = ["derive"] }
cmake = "0.1.50"
console = { version = "0.15.8", features = ["windows-console-colors"] }
criterion = "0.5"
dashmap = "5.5.3"
dashmap = "6.0.1"
difference = "2.0.0"
digest = "0.10.7"
dirs = "5.0.1"
Expand All @@ -77,8 +77,8 @@ humantime = "2.1.0"
indexmap = "2.2.6"
indicatif = "0.17.8"
insta = { version = "1.38.0" }
itertools = "0.12.1"
json-patch = "1.2.0"
itertools = "0.13.0"
json-patch = "2.0.0"
keyring = "2.3.2"
lazy-regex = "3.1.0"
lazy_static = "1.4.0"
Expand Down Expand Up @@ -107,12 +107,12 @@ reflink-copy = "0.1.16"
regex = "1.10.4"
reqwest = { version = "0.12.3", default-features = false }
reqwest-middleware = "0.3.0"
reqwest-retry = "0.5.0"
reqwest-retry = "0.6.0"
resolvo = { version = "0.6.1" }
retry-policies = { version = "0.3.0", default-features = false }
retry-policies = { version = "0.4.0", default-features = false }
rmp-serde = { version = "1.2.0" }
rstest = { version = "0.19.0" }
rstest_reuse = "0.6.0"
rstest = { version = "0.21.0" }
rstest_reuse = "0.7.0"
serde = { version = "1.0.198" }
serde_json = { version = "1.0.116" }
serde_repr = "0.1"
Expand Down Expand Up @@ -146,7 +146,7 @@ tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", default-features = false }
tracing-test = { version = "0.2.4" }
trybuild = { version = "1.0.91" }
typed-path = { version = "0.8.0" }
typed-path = { version = "0.9.0" }
url = { version = "2.5.0" }
uuid = { version = "1.8.0", default-features = false }
walkdir = "2.5.0"
Expand Down
1 change: 0 additions & 1 deletion crates/rattler-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ rustls-tls = ["reqwest/rustls-tls", "rattler/rustls-tls", "rattler_repodata_gate
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] }
console = { workspace = true, features = ["windows-console-colors"] }
futures = { workspace = true }
indicatif = { workspace = true }
once_cell = { workspace = true }
rattler = { path="../rattler", version = "0.26.5", default-features = false, features = ["indicatif"] }
Expand Down
4 changes: 0 additions & 4 deletions crates/rattler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ indicatif = ['dep:indicatif', 'dep:console']

[dependencies]
anyhow = { workspace = true }
bytes = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true, optional = true }
digest = { workspace = true }
dirs = { workspace = true }
fs-err = { workspace = true }
futures = { workspace = true }
fxhash = { workspace = true }
humantime = { workspace = true }
indexmap = { workspace = true }
indicatif = { workspace = true, optional = true }
Expand All @@ -50,7 +47,6 @@ simple_spawn_blocking = { path = "../simple_spawn_blocking", version = "1.0", de
tempfile = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["rt", "io-util", "macros"] }
tokio-stream = { workspace = true, features = ["sync"] }
tracing = { workspace = true }
url = { workspace = true, features = ["serde"] }
uuid = { workspace = true, features = ["v4", "fast-rng"] }
Expand Down
1 change: 0 additions & 1 deletion crates/rattler_cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ readme.workspace = true

[dependencies]
anyhow.workspace = true
chrono.workspace = true
dirs.workspace = true
fxhash.workspace = true
itertools.workspace = true
Expand Down
14 changes: 9 additions & 5 deletions crates/rattler_cache/src/package_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use std::{
future::Future,
path::PathBuf,
sync::Arc,
time::{Duration, SystemTime},
};

use chrono::Utc;
use fxhash::FxHashMap;
use itertools::Itertools;
use parking_lot::Mutex;
Expand Down Expand Up @@ -252,7 +252,7 @@ impl PackageCache {
retry_policy: impl RetryPolicy + Send + 'static,
reporter: Option<Arc<dyn CacheReporter>>,
) -> Result<PathBuf, PackageCacheError> {
let request_start = Utc::now();
let request_start = SystemTime::now();
let cache_key = pkg.into();
let sha256 = cache_key.sha256();
let download_reporter = reporter.clone();
Expand Down Expand Up @@ -296,7 +296,7 @@ impl PackageCache {
RetryDecision::Retry { execute_after } => execute_after,
RetryDecision::DoNotRetry => return Err(err),
};
let duration = (execute_after - Utc::now()).to_std().expect("the retry duration is out of range");
let duration = execute_after.duration_since(SystemTime::now()).unwrap_or(Duration::ZERO);

// Wait for a second to let the remote service restore itself. This increases the
// chance of success.
Expand Down Expand Up @@ -401,9 +401,13 @@ impl DownloadReporter for PassthroughReporter {

#[cfg(test)]
mod test {
use std::path::PathBuf;
use std::{
convert::Infallible, fs::File, future::IntoFuture, net::SocketAddr, path::Path, sync::Arc,
convert::Infallible,
fs::File,
future::IntoFuture,
net::SocketAddr,
path::{Path, PathBuf},
sync::Arc,
};

use assert_matches::assert_matches;
Expand Down
2 changes: 1 addition & 1 deletion crates/rattler_digest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ serde = { workspace = true, features = ["derive"], optional = true }
serde_with = { workspace = true }
sha2 = { workspace = true }
tokio = { workspace = true, features = ["io-util"], optional = true }
generic-array = { workspace = true }
generic-array = { workspace = true, optional = true }

[features]
tokio = ["dep:tokio"]
Expand Down
2 changes: 1 addition & 1 deletion crates/rattler_libsolv_c/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ libz-sys = { workspace = true, features = ["static"] }
anyhow = { workspace = true }
# 1.0.84 would fail to compile this library specifically on macOS.
# For now we just pin an older version.
cc = "=1.0.83"
cc = "1.0.106"
cmake = { workspace = true }

[package.metadata.cargo-udeps.ignore]
Expand Down
3 changes: 1 addition & 2 deletions crates/rattler_lock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ file_url = { path = "../file_url", version = "0.1.2" }
pep508_rs = { workspace = true, features = ["serde"] }
pep440_rs = { workspace = true, features = ["serde"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
serde_with = { workspace = true, features = ["indexmap_2"] }
serde_repr = { workspace = true }
thiserror = { workspace = true }
url = { workspace = true, features = ["serde"] }
purl = { workspace = true, features = ["serde"] }

[dev-dependencies]
insta = { workspace = true, features = ["yaml"] }
similar-asserts = { workspace = true }
Expand Down
5 changes: 1 addition & 4 deletions crates/rattler_networking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ rustls-tls = ['reqwest/rustls-tls', "google-cloud-auth?/rustls-tls"]
anyhow = { workspace = true }
async-trait = { workspace = true }
base64 = { workspace = true }
bytes = { workspace = true }
chrono = { workspace = true }
dirs = { workspace = true }
fslock = { workspace = true }
futures = { workspace = true }
google-cloud-auth = { workspace = true, default-features = false, optional = true }
google-cloud-auth = { workspace = true, optional = true }
http = { workspace = true }
itertools = { workspace = true }
keyring = { workspace = true }
netrc-rs = { workspace = true }
pin-project-lite = { workspace = true }
reqwest = { workspace = true, features = ["json"] }
reqwest-middleware = { workspace = true }
retry-policies = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/rattler_networking/src/retry_policies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
//! This module also provides the [`DoNotRetryPolicy`] which is useful if you do not want to retry
//! anything.

use chrono::{DateTime, Utc};
pub use retry_policies::{policies::*, Jitter, RetryDecision, RetryPolicy};
use std::time::SystemTime;

/// A simple [`RetryPolicy`] that just never retries.
pub struct DoNotRetryPolicy;
impl RetryPolicy for DoNotRetryPolicy {
fn should_retry(&self, _: DateTime<Utc>, _: u32) -> RetryDecision {
fn should_retry(&self, _: SystemTime, _: u32) -> RetryDecision {
RetryDecision::DoNotRetry
}
}
Expand Down
10 changes: 4 additions & 6 deletions crates/rattler_repodata_gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ dashmap = { workspace = true }
dirs = { workspace = true }
file_url = { path = "../file_url", version = "0.1.2" }
futures = { workspace = true }
fxhash = { workspace = true, optional = true }
hex = { workspace = true, features = ["serde"] }
http = { workspace = true, optional = true }
http-cache-semantics = { workspace = true, optional = true, features = ["reqwest", "serde"] }
Expand Down Expand Up @@ -53,9 +52,7 @@ tokio-util = { workspace = true, features = ["codec", "io"] }
tracing = { workspace = true }
url = { workspace = true, features = ["serde"] }
zstd = { workspace = true }
percent-encoding = { workspace = true }
rattler_cache = { version = "0.1.1", path = "../rattler_cache" }
rattler_package_streaming = { version = "0.21.4", path = "../rattler_package_streaming", default-features = false, features = ["reqwest"] }

[target.'cfg(unix)'.dependencies]
libc = { workspace = true }
Expand All @@ -66,15 +63,16 @@ windows-sys = { workspace = true, features = ["Win32_Storage_FileSystem", "Win32
[dev-dependencies]
assert_matches = { workspace = true }
axum = { workspace = true, features = ["tokio"] }
fslock = { workspace = true }
hex-literal = { workspace = true }
insta = { workspace = true, features = ["yaml"] }
rattler_conda_types = { path = "../rattler_conda_types", default-features = false }
rattler_package_streaming = { path = "../rattler_package_streaming", default-features = false, features = ["reqwest"] }
rstest = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread"] }
tools = { path="../tools" }
tower-http = { workspace = true, features = ["fs", "compression-gzip", "trace"] }
tracing-test = { workspace = true }
rattler_conda_types = { path = "../rattler_conda_types", version = "0.26.0", default-features = false }
fslock = { workspace = true }
tools = { path="../tools" }

[features]
default = ['native-tls']
Expand Down
Loading

0 comments on commit 09a0ba9

Please sign in to comment.