Skip to content

Commit

Permalink
uv/tests: add test specific filters
Browse files Browse the repository at this point in the history
This is to account for slight differences on our Windows CI.
  • Loading branch information
BurntSushi committed Sep 3, 2024
1 parent def7a17 commit 8e1535c
Showing 1 changed file with 58 additions and 12 deletions.
70 changes: 58 additions & 12 deletions crates/uv/tests/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12058,12 +12058,26 @@ exceptiongroup==1.0.0rc8
",
)?;

uv_snapshot!(context
.pip_compile()
.arg("requirements.in")
.arg("-c").arg("constraints.txt")
.arg("--universal")
.arg("-p").arg("3.10"), @r###"
let filters: Vec<_> = [
// 3.10 may not be installed
(
"warning: The requested Python version 3.10 is not available; .* will be used to build dependencies instead.\n",
"",
),
]
.into_iter()
.chain(context.filters())
.collect();

uv_snapshot!(
filters,
context
.pip_compile()
.arg("requirements.in")
.arg("-c").arg("constraints.txt")
.arg("--universal")
.arg("-p").arg("3.10"),
@r###"
success: true
exit_code: 0
----- stdout -----
Expand Down Expand Up @@ -12173,9 +12187,25 @@ matplotlib
",
)?;

uv_snapshot!(context
.pip_compile()
.arg("requirements.in").arg("--universal").arg("-p").arg("3.8"), @r###"
let filters: Vec<_> = [
// 3.8 may not be installed
(
"warning: The requested Python version 3.8 is not available; .* will be used to build dependencies instead.\n",
"",
),
]
.into_iter()
.chain(context.filters())
.collect();

uv_snapshot!(
filters,
context
.pip_compile()
.arg("requirements.in")
.arg("--universal")
.arg("-p").arg("3.8"),
@r###"
success: true
exit_code: 0
----- stdout -----
Expand Down Expand Up @@ -12245,9 +12275,25 @@ fn importlib_metadata_not_repeated() -> Result<()> {
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("build")?;

uv_snapshot!(context
.pip_compile()
.arg("requirements.in").arg("--universal").arg("-p").arg("3.7"), @r###"
let filters: Vec<_> = [
// 3.7 may not be installed
(
"warning: The requested Python version 3.7 is not available; .* will be used to build dependencies instead.\n",
"",
),
]
.into_iter()
.chain(context.filters())
.collect();

uv_snapshot!(
filters,
context
.pip_compile()
.arg("requirements.in")
.arg("--universal")
.arg("-p").arg("3.7"),
@r###"
success: true
exit_code: 0
----- stdout -----
Expand Down

0 comments on commit 8e1535c

Please sign in to comment.