mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-01 04:17:37 +00:00
Quote version parse errors consistently (#3325)
This commit is contained in:
parent
d57af514d9
commit
100dbe475c
4 changed files with 9 additions and 8 deletions
|
|
@ -2141,7 +2141,7 @@ impl std::fmt::Display for VersionParseError {
|
|||
} => {
|
||||
write!(
|
||||
f,
|
||||
"after parsing {version}, found {remaining:?} after it, \
|
||||
"after parsing '{version}', found '{remaining}', \
|
||||
which is not part of a valid version",
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1997,10 +1997,11 @@ mod tests {
|
|||
fn error_invalid_prerelease() {
|
||||
assert_snapshot!(
|
||||
parse_pepe508_err("name==1.0.org1"),
|
||||
@"
|
||||
after parsing 1.0, found \".org1\" after it, which is not part of a valid version
|
||||
name==1.0.org1
|
||||
^^^^^^^^^^"
|
||||
@r###"
|
||||
after parsing '1.0', found '.org1', which is not part of a valid version
|
||||
name==1.0.org1
|
||||
^^^^^^^^^^
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -984,7 +984,7 @@ fn compile_python_invalid_version() -> Result<()> {
|
|||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
error: invalid value '3.7.x' for '--python-version <PYTHON_VERSION>': after parsing 3.7, found ".x" after it, which is not part of a valid version
|
||||
error: invalid value '3.7.x' for '--python-version <PYTHON_VERSION>': after parsing '3.7', found '.x', which is not part of a valid version
|
||||
|
||||
For more information, try '--help'.
|
||||
"###
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ fn invalid_requirement() -> Result<()> {
|
|||
|
||||
----- stderr -----
|
||||
error: Failed to parse `flask==1.0.x`
|
||||
Caused by: after parsing 1.0, found ".x" after it, which is not part of a valid version
|
||||
Caused by: after parsing '1.0', found '.x', which is not part of a valid version
|
||||
flask==1.0.x
|
||||
^^^^^^^
|
||||
"###);
|
||||
|
|
@ -141,7 +141,7 @@ fn invalid_requirements_txt_requirement() -> Result<()> {
|
|||
|
||||
----- stderr -----
|
||||
error: Couldn't parse requirement in `requirements.txt` at position 0
|
||||
Caused by: after parsing 1.0, found ".x" after it, which is not part of a valid version
|
||||
Caused by: after parsing '1.0', found '.x', which is not part of a valid version
|
||||
flask==1.0.x
|
||||
^^^^^^^
|
||||
"###);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue