From 814b3c45bc2f4658ca400d6fa752a74270a0fbe5 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 3 Jul 2024 14:28:40 -0400 Subject: [PATCH] Fix misleading description contains docstring (#4783) ## Summary This doesn't include pre-releases by default. Maybe it did at one point! --- crates/pep440-rs/src/version_specifier.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/crates/pep440-rs/src/version_specifier.rs b/crates/pep440-rs/src/version_specifier.rs index 09f589ab5..01968bc8a 100644 --- a/crates/pep440-rs/src/version_specifier.rs +++ b/crates/pep440-rs/src/version_specifier.rs @@ -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`. /// - /// Unlike `pypa/packaging`, prereleases are included by default - /// - /// I'm utterly non-confident in the description in PEP 440 and apparently even pip got some - /// of that wrong, e.g. and - /// , and also i'm not sure if it produces the correct - /// behaviour from a user perspective - /// - /// This implementation is as close as possible to - /// + /// See: + /// - + /// - pub fn contains(&self, version: &Version) -> bool { // "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