Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote version parse errors consistently #3325

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/pep440-rs/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
}
Expand Down
9 changes: 5 additions & 4 deletions crates/pep508-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1986,10 +1986,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
^^^^^^^^^^
"###
);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/uv/tests/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
"###
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/tests/pip_uninstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^
"###);
Expand Down Expand Up @@ -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
^^^^^^^
"###);
Expand Down
Loading