mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-28 18:54:10 +00:00
Make < exclusive for non-prerelease markers (#1878)
## Summary Even when pre-releases are "allowed", per PEP 440, `pydantic<2.0.0` should _not_ include pre-releases. This PR modifies the specifier translation to treat `pydantic<2.0.0` as `pydantic<2.0.0.min0`, where `min` is an internal-only version segment that's invisible to users. Closes https://github.com/astral-sh/uv/issues/1641.
This commit is contained in:
parent
53a250714c
commit
8d706b0f2a
10 changed files with 440 additions and 58 deletions
|
|
@ -95,4 +95,15 @@ impl PreReleaseStrategy {
|
|||
),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if a [`PackageName`] is allowed to have pre-release versions.
|
||||
pub(crate) fn allows(&self, package: &PackageName) -> bool {
|
||||
match self {
|
||||
Self::Disallow => false,
|
||||
Self::Allow => true,
|
||||
Self::IfNecessary => false,
|
||||
Self::Explicit(packages) => packages.contains(package),
|
||||
Self::IfNecessaryOrExplicit(packages) => packages.contains(package),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue