mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Fix misleading description contains docstring (#4783)
## Summary This doesn't include pre-releases by default. Maybe it did at one point!
This commit is contained in:
parent
c17761904e
commit
814b3c45bc
1 changed files with 5 additions and 12 deletions
|
@ -462,20 +462,13 @@ impl VersionSpecifier {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Whether the given version satisfies the version range
|
/// Whether the given version satisfies the version range.
|
||||||
///
|
///
|
||||||
/// e.g. `>=1.19,<2.0` and `1.21` -> true
|
/// For example, `>=1.19,<2.0` contains `1.21`, but not `2.0`.
|
||||||
/// <https://peps.python.org/pep-0440/#version-specifiers>
|
|
||||||
///
|
///
|
||||||
/// Unlike `pypa/packaging`, prereleases are included by default
|
/// See:
|
||||||
///
|
/// - <https://peps.python.org/pep-0440/#version-specifiers>
|
||||||
/// I'm utterly non-confident in the description in PEP 440 and apparently even pip got some
|
/// - <https://github.com/pypa/packaging/blob/e184feef1a28a5c574ec41f5c263a3a573861f5a/packaging/specifiers.py#L362-L496>
|
||||||
/// of that wrong, e.g. <https://github.com/pypa/pip/issues/9121> and
|
|
||||||
/// <https://github.com/pypa/pip/issues/5503>, and also i'm not sure if it produces the correct
|
|
||||||
/// behaviour from a user perspective
|
|
||||||
///
|
|
||||||
/// This implementation is as close as possible to
|
|
||||||
/// <https://github.com/pypa/packaging/blob/e184feef1a28a5c574ec41f5c263a3a573861f5a/packaging/specifiers.py#L362-L496>
|
|
||||||
pub fn contains(&self, version: &Version) -> bool {
|
pub fn contains(&self, version: &Version) -> bool {
|
||||||
// "Except where specifically noted below, local version identifiers MUST NOT be permitted
|
// "Except where specifically noted below, local version identifiers MUST NOT be permitted
|
||||||
// in version specifiers, and local version labels MUST be ignored entirely when checking
|
// in version specifiers, and local version labels MUST be ignored entirely when checking
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue