diff --git a/Cargo.lock b/Cargo.lock index db3eb19..10a0a32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,7 +46,7 @@ dependencies = [ [[package]] name = "anysnake2" -version = "1.3.2" +version = "1.4.0" dependencies = [ "anyhow", "base64", @@ -66,7 +66,6 @@ dependencies = [ "serde_json", "sha256", "stderrlog", - "tempdir", "tempfile", "terminal_size", "toml", @@ -89,15 +88,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" +checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f" dependencies = [ "addr2line", "cc", @@ -223,9 +222,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] @@ -295,12 +294,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "generic-array" version = "0.14.5" @@ -418,9 +411,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.103" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" +checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" [[package]] name = "lock_api" @@ -534,9 +527,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" [[package]] name = "opaque-debug" @@ -576,9 +569,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] @@ -591,50 +584,13 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.10" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" version = "0.1.57" @@ -787,9 +743,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "spin" @@ -818,25 +774,15 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "syn" -version = "1.0.80" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] -[[package]] -name = "tempdir" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -dependencies = [ - "rand", - "remove_dir_all", -] - [[package]] name = "tempfile" version = "3.3.0" @@ -945,9 +891,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.13.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367437aa05be74122fa0d982b84a91938871df88c69edb759ed1c310724fe2d9" +checksum = "744e9ed5b352340aa47ce033716991b5589e23781acb97cad37d4ea70560f55b" dependencies = [ "combine", "indexmap", diff --git a/Cargo.toml b/Cargo.toml index 1f33d68..cd9f24a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,6 @@ serde = {version="1.0.130", features = ["derive"]} serde_json = "1.0" sha256 = "1.0.2" stderrlog = "0.5.1" -tempdir = "0.3.7" tempfile = "3.3.0" terminal_size = "0.1.17" toml = "0.5" diff --git a/flake.nix b/flake.nix index 4548e85..cb592de 100644 --- a/flake.nix +++ b/flake.nix @@ -44,7 +44,7 @@ # `nix develop` devShell = pkgs.mkShell { # supply the specific rust version - nativeBuildInputs = [ rust pkgs.rust-analyzer pkgs.git pkgs.cargo-udeps]; + nativeBuildInputs = [ rust pkgs.rust-analyzer pkgs.git pkgs.cargo-udeps pkgs.cargo-audit]; }; }); } diff --git a/src/main.rs b/src/main.rs index f6f1577..5c130bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1133,8 +1133,8 @@ fn fill_venv( if !to_build.is_empty() { for (safe_pkg, target_dir) in to_build.iter() { info!("Pip install {:?}", &target_dir); - let td = tempdir::TempDir::new("anysnake_venv")?; // temp /tmp - let td_home = tempdir::TempDir::new("anysnake_venv")?; // temp home directory + let td = tempfile::Builder::new().prefix("anysnake_venv").tempdir()?; // temp /tmp + let td_home = tempfile::Builder::new().prefix("anysnake_venv").tempdir()?; // temp home directory let td_home_str = td_home.path().to_string_lossy().to_string(); let target_python: PathBuf = diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 3c2da79..e8730b3 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,7 +1,7 @@ use named_lock::NamedLock; use std::path::PathBuf; use std::process::Command; -use tempdir::TempDir; +use tempfile::TempDir; fn run_test(cwd: &str, args: &[&str]) -> (i32, String, String) { //can't have more than one running from a given folder at a time @@ -44,7 +44,7 @@ fn run_test(cwd: &str, args: &[&str]) -> (i32, String, String) { } fn run_test_tempdir(cwd: &str, args: &[&str]) -> ((i32, String, String), TempDir) { - let td = TempDir::new("anysnake_test").expect("could not create tempdir"); + let td = tempfile::Builder::new().prefix("anysnake_test").tempdir().expect("could not create tempdir"); /* std::fs::copy( PathBuf::from(&cwd).join("anysnake2.toml"), td.path().join("anysnake2.toml"),