Be more precise in unpinned packages warning (#13426)

Fixes #13424
This commit is contained in:
konsti 2025-05-13 09:25:05 +02:00 committed by GitHub
parent ca725d08f2
commit 22b1ed5c5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

View File

@ -2785,7 +2785,7 @@ impl ForkState {
warn_user_once!(
"The direct dependency `{name}` is unpinned. \
Consider setting a lower bound when using `--resolution lowest` \
to avoid using outdated versions.",
or `--resolution lowest-direct` to avoid using outdated versions.",
name = package.name_no_root().unwrap(),
);
}

View File

@ -7036,15 +7036,15 @@ fn lock_unsafe_lowest() -> Result<()> {
"#,
)?;
uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct"), @r###"
uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct"), @r"
success: true
exit_code: 0
----- stdout -----
----- stderr -----
warning: The direct dependency `iniconfig` is unpinned. Consider setting a lower bound when using `--resolution lowest` to avoid using outdated versions.
warning: The direct dependency `iniconfig` is unpinned. Consider setting a lower bound when using `--resolution lowest` or `--resolution lowest-direct` to avoid using outdated versions.
Resolved 2 packages in [TIME]
"###);
");
// Re-run with `--locked`.
uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct").arg("--locked"), @r###"

View File

@ -12620,7 +12620,7 @@ fn compile_index_url_unsafe_lowest() -> Result<()> {
.arg("--extra-index-url")
.arg("https://test.pypi.org/simple")
.arg("requirements.in")
.arg("--no-deps"), @r###"
.arg("--no-deps"), @r"
success: true
exit_code: 0
----- stdout -----
@ -12630,9 +12630,9 @@ fn compile_index_url_unsafe_lowest() -> Result<()> {
# via -r requirements.in
----- stderr -----
warning: The direct dependency `anyio` is unpinned. Consider setting a lower bound when using `--resolution lowest` to avoid using outdated versions.
warning: The direct dependency `anyio` is unpinned. Consider setting a lower bound when using `--resolution lowest` or `--resolution lowest-direct` to avoid using outdated versions.
Resolved 1 package in [TIME]
"###
"
);
Ok(())
@ -14960,7 +14960,7 @@ fn compile_lowest_extra_unpinned_warning() -> Result<()> {
.arg("--index-url")
.arg(packse_index_url())
.arg(requirements_in.path())
.env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
.env_remove(EnvVars::UV_EXCLUDE_NEWER), @r"
success: true
exit_code: 0
----- stdout -----
@ -14978,9 +14978,9 @@ fn compile_lowest_extra_unpinned_warning() -> Result<()> {
# all-extras-required-a
----- stderr -----
warning: The direct dependency `all-extras-required-a` is unpinned. Consider setting a lower bound when using `--resolution lowest` to avoid using outdated versions.
warning: The direct dependency `all-extras-required-a` is unpinned. Consider setting a lower bound when using `--resolution lowest` or `--resolution lowest-direct` to avoid using outdated versions.
Resolved 3 packages in [TIME]
"###
"
);
Ok(())