Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bz2 builds from tests #3809

Merged
merged 2 commits into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions crates/uv/tests/pip_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,15 +658,17 @@ fn install_sdist_archive_type_bz2() -> Result<()> {
let context = TestContext::new("3.8");

let requirements_txt = context.temp_dir.child("requirements.txt");
requirements_txt.write_str("bz2==1.0.0")?;
requirements_txt.write_str(&format!(
"bz2 @ {}",
context
.workspace_root
.join("scripts/links/bz2-1.0.0.tar.bz2")
.display()
))?;

uv_snapshot!(command(&context)
uv_snapshot!(context.filters(), command(&context)
.arg("requirements.txt")
.arg("--no-binary")
.arg(":all:")
.arg("--strict")
.arg("--find-links")
.arg(context.workspace_root.join("scripts/links/")), @r###"
.arg("--strict"), @r###"
success: true
exit_code: 0
----- stdout -----
Expand All @@ -675,7 +677,7 @@ fn install_sdist_archive_type_bz2() -> Result<()> {
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Installed 1 package in [TIME]
+ bz2==1.0.0
+ bz2==1.0.0 (from file://[WORKSPACE]/scripts/links/bz2-1.0.0.tar.bz2)
"###
);

Expand Down Expand Up @@ -1255,17 +1257,9 @@ fn install_url_source_dist_cached() -> Result<()> {
let context = TestContext::new("3.12");

let requirements_txt = context.temp_dir.child("requirements.txt");
requirements_txt.write_str("tqdm @ https://files.pythonhosted.org/packages/62/06/d5604a70d160f6a6ca5fd2ba25597c24abd5c5ca5f437263d177ac242308/tqdm-4.66.1.tar.gz")?;
requirements_txt.write_str("source_distribution @ https://files.pythonhosted.org/packages/10/1f/57aa4cce1b1abf6b433106676e15f9fa2c92ed2bd4cf77c3b50a9e9ac773/source_distribution-0.0.1.tar.gz")?;

let filters = if cfg!(windows) {
[("warning: The package `tqdm` requires `colorama ; platform_system == 'Windows'`, but it's not installed.\n", "")]
.into_iter()
.chain(context.filters())
.collect()
} else {
context.filters()
};
uv_snapshot!(filters, command(&context)
uv_snapshot!(command(&context)
.arg("requirements.txt")
.arg("--strict"), @r###"
success: true
Expand All @@ -1276,18 +1270,20 @@ fn install_url_source_dist_cached() -> Result<()> {
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Installed 1 package in [TIME]
+ tqdm==4.66.1 (from https://files.pythonhosted.org/packages/62/06/d5604a70d160f6a6ca5fd2ba25597c24abd5c5ca5f437263d177ac242308/tqdm-4.66.1.tar.gz)
+ source-distribution==0.0.1 (from https://files.pythonhosted.org/packages/10/1f/57aa4cce1b1abf6b433106676e15f9fa2c92ed2bd4cf77c3b50a9e9ac773/source_distribution-0.0.1.tar.gz)
"###
);

context.assert_command("import tqdm").success();
context
.assert_command("import source_distribution")
.success();

// Re-run the installation in a new virtual environment.
let parent = context.temp_dir.child("parent");
parent.create_dir_all()?;
let venv = create_venv(&parent, &context.cache_dir, "3.12");

uv_snapshot!(filters, command(&context)
uv_snapshot!(command(&context)
.arg("requirements.txt")
.arg("--strict")
.env("VIRTUAL_ENV", venv.as_os_str()), @r###"
Expand All @@ -1298,11 +1294,13 @@ fn install_url_source_dist_cached() -> Result<()> {
----- stderr -----
Resolved 1 package in [TIME]
Installed 1 package in [TIME]
+ tqdm==4.66.1 (from https://files.pythonhosted.org/packages/62/06/d5604a70d160f6a6ca5fd2ba25597c24abd5c5ca5f437263d177ac242308/tqdm-4.66.1.tar.gz)
+ source-distribution==0.0.1 (from https://files.pythonhosted.org/packages/10/1f/57aa4cce1b1abf6b433106676e15f9fa2c92ed2bd4cf77c3b50a9e9ac773/source_distribution-0.0.1.tar.gz)
"###
);

context.assert_command("import tqdm").success();
context
.assert_command("import source_distribution")
.success();

// Clear the cache, then re-run the installation in a new virtual environment.
let parent = context.temp_dir.child("parent");
Expand All @@ -1311,7 +1309,7 @@ fn install_url_source_dist_cached() -> Result<()> {

uv_snapshot!(Command::new(get_bin())
.arg("clean")
.arg("tqdm")
.arg("source_distribution")
.arg("--cache-dir")
.arg(context.cache_dir.path())
.env("VIRTUAL_ENV", venv.as_os_str())
Expand All @@ -1321,11 +1319,11 @@ fn install_url_source_dist_cached() -> Result<()> {
----- stdout -----

----- stderr -----
Removed 127 files for tqdm ([SIZE])
Removed 13 files for source-distribution ([SIZE])
"###
);

uv_snapshot!(filters, command(&context)
uv_snapshot!(command(&context)
.arg("requirements.txt")
.arg("--strict")
.env("VIRTUAL_ENV", venv.as_os_str()), @r###"
Expand All @@ -1337,11 +1335,13 @@ fn install_url_source_dist_cached() -> Result<()> {
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Installed 1 package in [TIME]
+ tqdm==4.66.1 (from https://files.pythonhosted.org/packages/62/06/d5604a70d160f6a6ca5fd2ba25597c24abd5c5ca5f437263d177ac242308/tqdm-4.66.1.tar.gz)
+ source-distribution==0.0.1 (from https://files.pythonhosted.org/packages/10/1f/57aa4cce1b1abf6b433106676e15f9fa2c92ed2bd4cf77c3b50a9e9ac773/source_distribution-0.0.1.tar.gz)
"###
);

context.assert_command("import tqdm").success();
context
.assert_command("import source_distribution")
.success();

Ok(())
}
Expand Down
Loading