Skip to content

Commit

Permalink
remove / move unused or test crates (#8929)
Browse files Browse the repository at this point in the history
### Description

Flushing some old branches.

Tempdir is deprecated. Long live tempfile. Also did the liberty of
running udeps and sorting some dev deps out. Saving entire grams of CO2.

### Testing Instructions

Existing tests cover. Split into two commits since tempdir is the
majority here.
  • Loading branch information
arlyon authored Aug 5, 2024
1 parent d50a5a9 commit 1f0ccdd
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 111 deletions.
87 changes: 12 additions & 75 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/turborepo-api-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ native-tls = ["reqwest/native-tls"]
rustls-tls = ["reqwest/rustls-tls-native-roots"]

[dev-dependencies]
anyhow = { workspace = true }
http = "0.2.9"
httpmock = { workspace = true }
port_scanner = { workspace = true }
Expand All @@ -20,7 +21,6 @@ turborepo-vercel-api-mock = { workspace = true }
workspace = true

[dependencies]
anyhow = { workspace = true }
bytes.workspace = true
chrono = { workspace = true, features = ["serde"] }
lazy_static = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-ci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ workspace = true

[dependencies]
chrono = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
test-case = "3.1.0"
tracing = { workspace = true }
4 changes: 3 additions & 1 deletion crates/turborepo-env/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ hex = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
sha2 = { workspace = true }
test-case = { workspace = true }
thiserror = { workspace = true }

[dev-dependencies]
test-case = { workspace = true }
2 changes: 1 addition & 1 deletion crates/turborepo-filewatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ radix_trie = { workspace = true }
thiserror = "1.0.38"
tokio = { workspace = true, features = ["full", "time"] }
tracing = "0.1.37"
tracing-test = "0.2.4"
turbopath = { workspace = true }
turborepo-repository = { version = "0.1.0", path = "../turborepo-repository" }
turborepo-scm = { workspace = true }
Expand All @@ -39,6 +38,7 @@ version = "0.2.4"
git2 = { version = "0.16.1", default-features = false }
tempfile = { workspace = true }
tokio-scoped = "0.2.0"
tracing-test = "0.2.4"

[features]
default = ["macos_fsevent"]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-globwalk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ walkdir = "2.3.3"
wax.workspace = true

[dev-dependencies]
tempdir = "0.3.7"
tempfile = { workspace = true }
test-case = "3.1.0"
14 changes: 7 additions & 7 deletions crates/turborepo-globwalk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ mod test {
use std::{collections::HashSet, str::FromStr};

use itertools::Itertools;
use tempdir::TempDir;
use tempfile::TempDir;
use test_case::test_case;
use turbopath::{AbsoluteSystemPath, AbsoluteSystemPathBuf};

Expand Down Expand Up @@ -531,8 +531,8 @@ mod test {
}

/// set up a globwalk test in a tempdir, returning the path to the tempdir
fn setup() -> tempdir::TempDir {
let tmp = tempdir::TempDir::new("globwalk").unwrap();
fn setup() -> tempfile::TempDir {
let tmp = tempfile::TempDir::with_prefix("globwalk").unwrap();

let directories = ["a/b/c", "a/c", "abc", "axbxcxdxe/xxx", "axbxcxdxexxx", "b"];

Expand Down Expand Up @@ -1343,12 +1343,12 @@ mod test {
// TODO: this test needs to be implemented...
}

fn setup_files(files: &[&str]) -> tempdir::TempDir {
fn setup_files(files: &[&str]) -> tempfile::TempDir {
setup_files_with_prefix("globwalk", files)
}

fn setup_files_with_prefix(prefix: &str, files: &[&str]) -> tempdir::TempDir {
let tmp = tempdir::TempDir::new(prefix).unwrap();
fn setup_files_with_prefix(prefix: &str, files: &[&str]) -> tempfile::TempDir {
let tmp = tempfile::TempDir::with_prefix(prefix).unwrap();
for file in files {
let file = file.trim_start_matches('/');
let path = tmp.path().join(file);
Expand Down Expand Up @@ -1493,7 +1493,7 @@ mod test {
#[test_case("foo/", true, "foo/**" ; "dir slash")]
#[test_case("f[o0]o", true, "f[o0]o" ; "non-literal")]
fn test_add_double_star(glob: &str, is_dir: bool, expected: &str) {
let tmpdir = TempDir::new("doublestar").unwrap();
let tmpdir = TempDir::with_prefix("doublestar").unwrap();
let base = AbsoluteSystemPath::new(tmpdir.path().to_str().unwrap()).unwrap();

let foo = base.join_component("foo");
Expand Down
1 change: 0 additions & 1 deletion crates/turborepo-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ async-stream = "0.3.4"
itertools = { workspace = true }
port_scanner = { workspace = true }
pretty_assertions = { workspace = true }
tempdir = "0.3.7"
tempfile = { workspace = true }
test-case = { workspace = true }
tracing-test = { version = "0.2.4", features = ["no-env-filter"] }
Expand Down
Loading

0 comments on commit 1f0ccdd

Please sign in to comment.