mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Make > operator exclude post and local releases (#2471)
## Summary This PR attempts to use a similar trick to that we added in https://github.com/astral-sh/uv/pull/1878, but for post-releases. In https://github.com/astral-sh/uv/pull/1878, we added a fake "minimum" version to enable us to treat `< 1.0.0` as _excluding_ pre-releases of 1.0.0. Today, on `main`, we accept post-releases and local versions in `> 1.0.0`. But per PEP 440, that should _exclude_ post-releases and local versions, unless the specifier is itself a pre-release, in which case, pre-releases are allowed (e.g., `> 1.0.0.post0` should allow `> 1.0.0.post1`). To support this, we add a fake "maximum" version that's greater than all the post and local releases for a given version. This leverages our last remaining free bit in the compact representation.
This commit is contained in:
parent
c296da34bf
commit
e69b76bc72
6 changed files with 222 additions and 110 deletions
|
@ -537,7 +537,7 @@ impl CacheBucket {
|
|||
Self::FlatIndex => "flat-index-v0",
|
||||
Self::Git => "git-v0",
|
||||
Self::Interpreter => "interpreter-v0",
|
||||
Self::Simple => "simple-v3",
|
||||
Self::Simple => "simple-v4",
|
||||
Self::Wheels => "wheels-v0",
|
||||
Self::Archive => "archive-v0",
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue