mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Use httpx
instead of anyio
for reinstall test (#1732)
This works on Windows.
This commit is contained in:
parent
4b5b9835fd
commit
254a94c40a
1 changed files with 37 additions and 35 deletions
|
@ -319,38 +319,12 @@ fn respect_installed_and_reinstall() -> Result<()> {
|
|||
|
||||
/// Respect installed versions when resolving.
|
||||
#[test]
|
||||
#[cfg(not(windows))]
|
||||
fn reinstall_extras() -> Result<()> {
|
||||
let context = TestContext::new("3.12");
|
||||
|
||||
// Install anyio.
|
||||
// Install httpx.
|
||||
let requirements_txt = context.temp_dir.child("requirements.txt");
|
||||
requirements_txt.write_str("anyio")?;
|
||||
|
||||
uv_snapshot!(command(&context)
|
||||
.arg("-r")
|
||||
.arg("requirements.txt")
|
||||
.arg("--strict"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Resolved 3 packages in [TIME]
|
||||
Downloaded 3 packages in [TIME]
|
||||
Installed 3 packages in [TIME]
|
||||
+ anyio==4.0.0
|
||||
+ idna==3.4
|
||||
+ sniffio==1.3.0
|
||||
"###
|
||||
);
|
||||
|
||||
context.assert_command("import anyio").success();
|
||||
|
||||
// Re-install anyio, with an extra.
|
||||
let requirements_txt = context.temp_dir.child("requirements.txt");
|
||||
requirements_txt.touch()?;
|
||||
requirements_txt.write_str("anyio[trio]")?;
|
||||
requirements_txt.write_str("httpx")?;
|
||||
|
||||
uv_snapshot!(command(&context)
|
||||
.arg("-r")
|
||||
|
@ -362,16 +336,44 @@ fn reinstall_extras() -> Result<()> {
|
|||
|
||||
----- stderr -----
|
||||
Resolved 7 packages in [TIME]
|
||||
Downloaded 4 packages in [TIME]
|
||||
Installed 4 packages in [TIME]
|
||||
+ attrs==23.1.0
|
||||
+ outcome==1.3.0.post0
|
||||
+ sortedcontainers==2.4.0
|
||||
+ trio==0.23.1
|
||||
Downloaded 7 packages in [TIME]
|
||||
Installed 7 packages in [TIME]
|
||||
+ anyio==4.0.0
|
||||
+ certifi==2023.11.17
|
||||
+ h11==0.14.0
|
||||
+ httpcore==1.0.2
|
||||
+ httpx==0.25.1
|
||||
+ idna==3.4
|
||||
+ sniffio==1.3.0
|
||||
"###
|
||||
);
|
||||
|
||||
context.assert_command("import anyio").success();
|
||||
context.assert_command("import httpx").success();
|
||||
|
||||
// Re-install httpx, with an extra.
|
||||
let requirements_txt = context.temp_dir.child("requirements.txt");
|
||||
requirements_txt.touch()?;
|
||||
requirements_txt.write_str("httpx[http2]")?;
|
||||
|
||||
uv_snapshot!(command(&context)
|
||||
.arg("-r")
|
||||
.arg("requirements.txt")
|
||||
.arg("--strict"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Resolved 10 packages in [TIME]
|
||||
Downloaded 3 packages in [TIME]
|
||||
Installed 3 packages in [TIME]
|
||||
+ h2==4.1.0
|
||||
+ hpack==4.0.0
|
||||
+ hyperframe==6.0.1
|
||||
"###
|
||||
);
|
||||
|
||||
context.assert_command("import httpx").success();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue