diff --git a/crates/uv/tests/lock.rs b/crates/uv/tests/lock.rs index 39730be2c..e7433cf01 100644 --- a/crates/uv/tests/lock.rs +++ b/crates/uv/tests/lock.rs @@ -111,6 +111,17 @@ fn lock_wheel_registry() -> Result<()> { }); } + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 4 packages in [TIME] + "###); + // Install from the lockfile. uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" success: true @@ -185,6 +196,17 @@ fn lock_sdist_registry() -> Result<()> { }); } + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove("UV_EXCLUDE_NEWER"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 2 packages in [TIME] + "###); + // Install from the lockfile. uv_snapshot!(context.filters(), context.sync().arg("--frozen").env_remove("UV_EXCLUDE_NEWER"), @r###" success: true @@ -261,6 +283,18 @@ fn lock_sdist_git() -> Result<()> { }); } + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + warning: `uv.sources` is experimental and may change without warning + Resolved 2 packages in [TIME] + "###); + // Re-run with `--locked`. uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" success: true @@ -757,6 +791,17 @@ fn lock_wheel_url() -> Result<()> { }); } + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 4 packages in [TIME] + "###); + // Install from the lockfile. uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" success: true @@ -854,6 +899,17 @@ fn lock_sdist_url() -> Result<()> { }); } + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 4 packages in [TIME] + "###); + // Install from the lockfile. uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" success: true @@ -1263,6 +1319,17 @@ fn lock_dependency_extra() -> Result<()> { }); } + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 10 packages in [TIME] + "###); + // Install from the lockfile. uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" success: true @@ -1493,6 +1560,17 @@ fn lock_conditional_dependency_extra() -> Result<()> { }); } + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 7 packages in [TIME] + "###); + // Install from the lockfile. uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" success: true @@ -1517,6 +1595,17 @@ fn lock_conditional_dependency_extra() -> Result<()> { fs_err::copy(pyproject_toml, context_38.temp_dir.join("pyproject.toml"))?; fs_err::copy(lockfile, context_38.temp_dir.join("uv.lock"))?; + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 7 packages in [TIME] + "###); + // Install from the lockfile. uv_snapshot!(context_38.filters(), context_38.sync().arg("--frozen"), @r###" success: true @@ -1687,6 +1776,18 @@ fn lock_dependency_non_existent_extra() -> Result<()> { }); } + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 9 packages in [TIME] + warning: The package `flask==3.0.2` does not have an extra named `foo` + "###); + // Install from the lockfile. uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" success: true @@ -2777,6 +2878,17 @@ fn lock_requires_python() -> Result<()> { .chain([(" or `py` launcher", "")]) .collect(); + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 5 packages in [TIME] + "###); + // Install from the lockfile. // Note we need to disable Python fetches or we'll just download 3.12 uv_snapshot!(filters, context38.sync().arg("--frozen").arg("--python-fetch").arg("manual"), @r###" @@ -3844,6 +3956,17 @@ fn lock_cycles() -> Result<()> { }); } + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 11 packages in [TIME] + "###); + // Install from the lockfile. uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" success: true @@ -4174,8 +4297,19 @@ fn lock_invalid_hash() -> Result<()> { ] "#)?; + // Re-run with `--locked`. + uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove("UV_EXCLUDE_NEWER"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + warning: `uv lock` is experimental and may change without warning + Resolved 4 packages in [TIME] + "###); + // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").env_remove("UV_EXCLUDE_NEWER"), @r###" success: false exit_code: 2 ----- stdout -----