Skip to content

Commit 90fbc3a

Browse files
authored
Use Packse in uv check tests (astral-sh#19913)
Replace live-PyPI dependencies in `uv check` project lock and sync tests with existing Packse fixtures. The tests now pass the local index explicitly and use deterministic package metadata instead of `anyio`, `iniconfig`, and unnecessary CLI `--exclude-newer` cutoffs. This also moves declared-dependency and isolated-project coverage into the `test-r2` shard. The `TY` executable precedence test remains `test-pypi` gated because it requires installing a real `ty` executable; existing `TY` precedence and ty download tests are otherwise unchanged.
1 parent 6ab6d2f commit 90fbc3a

3 files changed

Lines changed: 157 additions & 109 deletions

File tree

crates/uv/tests/pip/pip_install_scenarios.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3409,6 +3409,43 @@ fn python_version_does_not_exist() {
34093409
context.assert_not_installed("a");
34103410
}
34113411

3412+
/// A single package with two stable versions.
3413+
///
3414+
/// ```text
3415+
/// single-package
3416+
/// ├── environment
3417+
/// │ └── python3.12
3418+
/// ├── root
3419+
/// │ └── requires a
3420+
/// │ ├── satisfied by a-1.0.0
3421+
/// │ └── satisfied by a-2.0.0
3422+
/// └── a
3423+
/// ├── a-1.0.0
3424+
/// └── a-2.0.0
3425+
/// ```
3426+
#[test]
3427+
fn single_package() {
3428+
let context = uv_test::test_context!("3.12");
3429+
let server = PackseServer::new("simple/single-package.toml");
3430+
3431+
uv_snapshot!(context.filters(), command(&context, &server)
3432+
.arg("a")
3433+
, @"
3434+
success: true
3435+
exit_code: 0
3436+
----- stdout -----
3437+
3438+
----- stderr -----
3439+
Resolved 1 package in [TIME]
3440+
Prepared 1 package in [TIME]
3441+
Installed 1 package in [TIME]
3442+
+ a==2.0.0
3443+
");
3444+
3445+
// The latest version of 'a' should be selected.
3446+
context.assert_installed("a", "2.0.0");
3447+
}
3448+
34123449
/// Both wheels and source distributions are available, and the user has disabled binaries.
34133450
///
34143451
/// ```text

0 commit comments

Comments
 (0)