mirror of https://github.com/astral-sh/uv
Allow `--check` and `--locked` to be used together in `uv lock` (#16538)
See https://github.com/astral-sh/uv/issues/16517#issuecomment-3473747461
This commit is contained in:
parent
1e2ec4a50c
commit
101d0e2892
|
|
@ -3753,7 +3753,7 @@ pub struct LockArgs {
|
||||||
/// missing or needs to be updated, uv will exit with an error.
|
/// missing or needs to be updated, uv will exit with an error.
|
||||||
///
|
///
|
||||||
/// Equivalent to `--locked`.
|
/// Equivalent to `--locked`.
|
||||||
#[arg(long, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["check_exists", "upgrade", "locked"])]
|
#[arg(long, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["check_exists", "upgrade"], overrides_with = "check")]
|
||||||
pub check: bool,
|
pub check: bool,
|
||||||
|
|
||||||
/// Check if the lockfile is up-to-date.
|
/// Check if the lockfile is up-to-date.
|
||||||
|
|
@ -3762,7 +3762,7 @@ pub struct LockArgs {
|
||||||
/// missing or needs to be updated, uv will exit with an error.
|
/// missing or needs to be updated, uv will exit with an error.
|
||||||
///
|
///
|
||||||
/// Equivalent to `--check`.
|
/// Equivalent to `--check`.
|
||||||
#[arg(long, env = EnvVars::UV_LOCKED, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["check_exists", "upgrade", "check"], hide = true)]
|
#[arg(long, env = EnvVars::UV_LOCKED, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["check_exists", "upgrade"], hide = true)]
|
||||||
pub locked: bool,
|
pub locked: bool,
|
||||||
|
|
||||||
/// Assert that a `uv.lock` exists without checking if it is up-to-date.
|
/// Assert that a `uv.lock` exists without checking if it is up-to-date.
|
||||||
|
|
|
||||||
|
|
@ -13392,6 +13392,19 @@ fn check_outdated_lock() -> Result<()> {
|
||||||
Resolved 2 packages in [TIME]
|
Resolved 2 packages in [TIME]
|
||||||
The lockfile at `uv.lock` needs to be updated, but `--check` was provided. To update the lockfile, run `uv lock`.
|
The lockfile at `uv.lock` needs to be updated, but `--check` was provided. To update the lockfile, run `uv lock`.
|
||||||
");
|
");
|
||||||
|
|
||||||
|
// Providing both `--check` and `--locked` is okay
|
||||||
|
uv_snapshot!(context.filters(), context.lock()
|
||||||
|
.arg("--check").arg("--locked"), @r"
|
||||||
|
success: false
|
||||||
|
exit_code: 1
|
||||||
|
----- stdout -----
|
||||||
|
|
||||||
|
----- stderr -----
|
||||||
|
Resolved 2 packages in [TIME]
|
||||||
|
The lockfile at `uv.lock` needs to be updated, but `--check` was provided. To update the lockfile, run `uv lock`.
|
||||||
|
");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue