mirror of https://github.com/astral-sh/uv
Quote version parse errors consistently (#3325)
This commit is contained in:
parent
d57af514d9
commit
100dbe475c
|
|
@ -2141,7 +2141,7 @@ impl std::fmt::Display for VersionParseError {
|
||||||
} => {
|
} => {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"after parsing {version}, found {remaining:?} after it, \
|
"after parsing '{version}', found '{remaining}', \
|
||||||
which is not part of a valid version",
|
which is not part of a valid version",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1997,10 +1997,11 @@ mod tests {
|
||||||
fn error_invalid_prerelease() {
|
fn error_invalid_prerelease() {
|
||||||
assert_snapshot!(
|
assert_snapshot!(
|
||||||
parse_pepe508_err("name==1.0.org1"),
|
parse_pepe508_err("name==1.0.org1"),
|
||||||
@"
|
@r###"
|
||||||
after parsing 1.0, found \".org1\" after it, which is not part of a valid version
|
after parsing '1.0', found '.org1', which is not part of a valid version
|
||||||
name==1.0.org1
|
name==1.0.org1
|
||||||
^^^^^^^^^^"
|
^^^^^^^^^^
|
||||||
|
"###
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -984,7 +984,7 @@ fn compile_python_invalid_version() -> Result<()> {
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
||||||
----- stderr -----
|
----- 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'.
|
For more information, try '--help'.
|
||||||
"###
|
"###
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ fn invalid_requirement() -> Result<()> {
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
error: Failed to parse `flask==1.0.x`
|
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
|
flask==1.0.x
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
"###);
|
"###);
|
||||||
|
|
@ -141,7 +141,7 @@ fn invalid_requirements_txt_requirement() -> Result<()> {
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
error: Couldn't parse requirement in `requirements.txt` at position 0
|
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
|
flask==1.0.x
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
"###);
|
"###);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue