uv/crates/uv-resolver
Charlie Marsh c4472ebbb9
Enforce and backtrack on invalid versions in source metadata (#2954)
## Summary

If we build a source distribution from the registry, and the version
doesn't match that of the filename, we should error, just as we do for
mismatched package names. However, we should also backtrack here, which
we didn't previously.

Closes https://github.com/astral-sh/uv/issues/2953.

## Test Plan

Verified that `cargo run pip install docutils --verbose --no-cache
--reinstall` installs `docutils==0.21` instead of the invalid
`docutils==0.21.post1`.

In the logs, I see:

```
WARN Unable to extract metadata for docutils: Package metadata version `0.21` does not match given version `0.21.post1`
```
2024-04-10 05:13:33 +00:00
..
src Enforce and backtrack on invalid versions in source metadata (#2954) 2024-04-10 05:13:33 +00:00
tests Split configuration options out of uv-types (#2924) 2024-04-09 11:35:53 -05:00
Cargo.toml Surface invalid metadata as hints in error reports (#2850) 2024-04-09 23:12:10 -04:00