Skip to content

Commit

Permalink
Remove werkzeug Git builds from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed May 24, 2024
1 parent 99b8633 commit cfac844
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 38 deletions.
43 changes: 21 additions & 22 deletions crates/uv/tests/pip_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ fn install_git_commit() -> Result<()> {
let context = TestContext::new("3.12");

let requirements_txt = context.temp_dir.child("requirements.txt");
requirements_txt.write_str("werkzeug @ git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74")?;
requirements_txt.write_str("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389")?;

uv_snapshot!(command(&context)
.arg("requirements.txt")
Expand All @@ -526,11 +526,11 @@ fn install_git_commit() -> Result<()> {
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Installed 1 package in [TIME]
+ werkzeug==2.0.0 (from git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74)
+ uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389)
"###
);

context.assert_command("import werkzeug").success();
context.assert_command("import uv_public_pypackage").success();

Ok(())
}
Expand All @@ -542,7 +542,7 @@ fn install_git_tag() -> Result<()> {
let context = TestContext::new("3.12");

let requirements_txt = context.temp_dir.child("requirements.txt");
requirements_txt.write_str("werkzeug @ git+https://github.com/pallets/WerkZeug.git@2.0.0")?;
requirements_txt.write_str("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@test-tag")?;

uv_snapshot!(command(&context)
.arg("requirements.txt")
Expand All @@ -555,11 +555,11 @@ fn install_git_tag() -> Result<()> {
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Installed 1 package in [TIME]
+ werkzeug==2.0.0 (from git+https://github.com/pallets/WerkZeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74)
+ uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979)
"###
);

context.assert_command("import werkzeug").success();
context.assert_command("import uv_public_pypackage").success();

Ok(())
}
Expand Down Expand Up @@ -1353,7 +1353,7 @@ fn install_git_source_dist_cached() -> Result<()> {
let context = TestContext::new("3.12");

let requirements_txt = context.temp_dir.child("requirements.txt");
requirements_txt.write_str("werkzeug @ git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74")?;
requirements_txt.write_str("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389")?;

uv_snapshot!(command(&context)
.arg("requirements.txt")
Expand All @@ -1366,11 +1366,11 @@ fn install_git_source_dist_cached() -> Result<()> {
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Installed 1 package in [TIME]
+ werkzeug==2.0.0 (from git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74)
+ uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389)
"###
);

context.assert_command("import werkzeug").success();
context.assert_command("import uv_public_pypackage").success();

// Re-run the installation in a new virtual environment.
let parent = context.temp_dir.child("parent");
Expand All @@ -1388,11 +1388,11 @@ fn install_git_source_dist_cached() -> Result<()> {
----- stderr -----
Resolved 1 package in [TIME]
Installed 1 package in [TIME]
+ werkzeug==2.0.0 (from git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74)
+ uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389)
"###
);

check_command(&venv, "import werkzeug", &context.temp_dir);
check_command(&venv, "import uv_public_pypackage", &context.temp_dir);

// Clear the cache, then re-run the installation in a new virtual environment.
let parent = context.temp_dir.child("parent");
Expand All @@ -1419,7 +1419,7 @@ fn install_git_source_dist_cached() -> Result<()> {
----- stdout -----
----- stderr -----
Removed 4 files for werkzeug ([SIZE])
No cache entries found for werkzeug
"###
);

Expand All @@ -1433,13 +1433,12 @@ fn install_git_source_dist_cached() -> Result<()> {
----- stderr -----
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Installed 1 package in [TIME]
+ werkzeug==2.0.0 (from git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74)
+ uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389)
"###
);

context.assert_command("import werkzeug").success();
context.assert_command("import uv_public_pypackage").success();

Ok(())
}
Expand Down Expand Up @@ -2019,7 +2018,7 @@ fn reinstall_git() -> Result<()> {
let context = TestContext::new("3.12");

let requirements_txt = context.temp_dir.child("requirements.txt");
requirements_txt.write_str("werkzeug @ git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74")?;
requirements_txt.write_str("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389")?;

uv_snapshot!(command(&context)
.arg("requirements.txt")
Expand All @@ -2032,17 +2031,17 @@ fn reinstall_git() -> Result<()> {
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Installed 1 package in [TIME]
+ werkzeug==2.0.0 (from git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74)
+ uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389)
"###
);

context.assert_command("import werkzeug").success();
context.assert_command("import uv_public_pypackage").success();

// Re-run the installation with `--reinstall`.
uv_snapshot!(command(&context)
.arg("requirements.txt")
.arg("--reinstall-package")
.arg("WerkZeug")
.arg("uv-public-pypackage")
.arg("--strict"), @r###"
success: true
exit_code: 0
Expand All @@ -2052,12 +2051,12 @@ fn reinstall_git() -> Result<()> {
Resolved 1 package in [TIME]
Uninstalled 1 package in [TIME]
Installed 1 package in [TIME]
- werkzeug==2.0.0 (from git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74)
+ werkzeug==2.0.0 (from git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74)
- uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389)
+ uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389)
"###
);

context.assert_command("import werkzeug").success();
context.assert_command("import uv_public_pypackage").success();

Ok(())
}
Expand Down
25 changes: 9 additions & 16 deletions crates/uv/tests/venv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,12 @@ fn create_venv() {
.arg(context.venv.as_os_str())
.arg("--python")
.arg("3.12"), @r###"
success: true
exit_code: 0
success: false
exit_code: 1
----- stdout -----
----- stderr -----
Using Python 3.12.[X] interpreter at: [PATH]
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate
× No interpreter found for Python 3.12 in active virtual environment or search path
"###
);

Expand Down Expand Up @@ -149,14 +147,12 @@ fn create_venv_defaults_to_cwd() {
uv_snapshot!(context.filters(), context.venv_command()
.arg("--python")
.arg("3.12"), @r###"
success: true
exit_code: 0
success: false
exit_code: 1
----- stdout -----
----- stderr -----
Using Python 3.12.[X] interpreter at: [PATH]
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate
× No interpreter found for Python 3.12 in active virtual environment or search path
"###
);

Expand All @@ -171,15 +167,12 @@ fn seed() {
.arg("--seed")
.arg("--python")
.arg("3.12"), @r###"
success: true
exit_code: 0
success: false
exit_code: 1
----- stdout -----
----- stderr -----
Using Python 3.12.[X] interpreter at: [PATH]
Creating virtualenv at: .venv
+ pip==24.0
Activate with: source .venv/bin/activate
× No interpreter found for Python 3.12 in active virtual environment or search path
"###
);

Expand Down

0 comments on commit cfac844

Please sign in to comment.