Fix pylock.toml config conflict error messages (#16211)

## Summary

When specifying constraints or overrides in combination with
`pylock.toml` as an input to `uv pip install`,
the error messages are not currently correct.

## Test Plan

No testing, it's a straightforward error string fix.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
Alyssa Coghlan 2025-10-10 03:38:18 +10:00 committed by GitHub
parent a58d031157
commit 628eedea36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -397,12 +397,12 @@ impl RequirementsSpecification {
}
if !constraints.is_empty() {
return Err(anyhow::anyhow!(
"Cannot specify additional requirements with a `pylock.toml` file"
"Cannot specify constraints with a `pylock.toml` file"
));
}
if !overrides.is_empty() {
return Err(anyhow::anyhow!(
"Cannot specify constraints with a `pylock.toml` file"
"Cannot specify overrides with a `pylock.toml` file"
));
}

View File

@ -11442,7 +11442,7 @@ fn pep_751_mix() -> Result<()> {
----- stdout -----
----- stderr -----
error: Cannot specify additional requirements with a `pylock.toml` file
error: Cannot specify constraints with a `pylock.toml` file
"
);