Skip to content

Commit

Permalink
replaced tempdir with tempfile (tempdir is unmaintained)
Browse files Browse the repository at this point in the history
  • Loading branch information
TyberiusPrime committed Feb 11, 2022
1 parent 3cc0c42 commit 8dd6ecb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 81 deletions.
96 changes: 21 additions & 75 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"),
Expand Down

0 comments on commit 8dd6ecb

Please sign in to comment.