Skip to content

Commit

Permalink
Update Rust crate fs-err to v3 (#8625)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored Nov 19, 2024
1 parent 07806c4 commit dae630a
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 46 deletions.
71 changes: 40 additions & 31 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ either = { version = "1.13.0" }
encoding_rs_io = { version = "0.1.7" }
etcetera = { version = "0.8.0" }
flate2 = { version = "1.0.33", default-features = false }
fs-err = { version = "2.11.0" }
fs-err = { version = "3.0.0" }
fs2 = { version = "0.4.3" }
futures = { version = "0.3.30" }
glob = { version = "0.3.1" }
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-build-backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ workspace = true

[dev-dependencies]
indoc = { version = "2.0.5" }
insta = { version = "1.40.0" }
insta = { version = "1.40.0", features = ["filters"] }
tempfile = { version = "3.12.0" }
11 changes: 9 additions & 2 deletions crates/uv-build-backend/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,15 @@ mod tests {
.unwrap()
.to_metadata(Path::new("/do/not/read"))
.unwrap_err();
// Simplified for windows compatibility.
assert_snapshot!(err.to_string().replace('\\', "/"), @"failed to open file `/do/not/read/Readme.md`");
// Strip away OS specific part.
let err = err
.to_string()
.replace('\\', "/")
.split_once(':')
.unwrap()
.0
.to_string();
assert_snapshot!(err, @"failed to open file `/do/not/read/Readme.md`");
}

#[test]
Expand Down
8 changes: 7 additions & 1 deletion crates/uv-requirements-txt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1406,13 +1406,19 @@ mod test {
let filters = vec![
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
(missing_txt.as_str(), "<MISSING_TXT>"),
// Windows translates error messages, for example i get:
// "Das System kann den angegebenen Pfad nicht finden. (os error 3)"
(
r": .* \(os error 2\)",
": The system cannot find the path specified. (os error 2)",
),
];
insta::with_settings!({
filters => filters,
}, {
insta::assert_snapshot!(errors, @r###"
Error parsing included file in `<REQUIREMENTS_TXT>` at position 0
failed to read from file `<MISSING_TXT>`
failed to read from file `<MISSING_TXT>`: The system cannot find the path specified. (os error 2)
"###);
});

Expand Down
4 changes: 2 additions & 2 deletions crates/uv-trampoline/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/uv-trampoline/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ embed-manifest = "1.4.0"
anyhow = { version = "1.0.80" }
assert_cmd = { version = "2.0.14" }
assert_fs = { version = "1.1.1" }
fs-err = { version = "2.11.0" }
fs-err = { version = "3.0.0" }
thiserror = { version = "2.0.0" }
which = { version = "7.0.0" }
zip = { version = "0.6.6", default-features = false, features = ["deflate"] }
3 changes: 1 addition & 2 deletions crates/uv/tests/it/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2850,8 +2850,7 @@ fn run_script_explicit_directory() -> Result<()> {
----- stdout -----
----- stderr -----
error: failed to read from file `script`
Caused by: Is a directory (os error 21)
error: failed to read from file `script`: Is a directory (os error 21)
"###);

Ok(())
Expand Down
Loading

0 comments on commit dae630a

Please sign in to comment.