Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Reorder `Specifier` regex groups to check wildcard matches early This ensures that an `re.match` or `re.search` does not exclude the wildcard in cases where it would otherwise match. Without this reordering, a regex match of a wildcard specifier would only match the version sections before it since both parts of the prior part of the unnamed group are optional, allowing the group to match an empty string even though it is optional as a whole. This does not affect `Specifier` since the regex used by it gets a `$` added to it, forcing the regular expression engine to backtrack in such cases. It does, however, affect `Requirement` since it is currently allowing these values through since they match the regex for `LegacySpecifier`. * Stop accepting legacy specifiers in `Requirement` * Remove `LegacySpecifier` class This class has been deprecated for multiple releases now. * Remove `LegacyVersion` class This class has been deprecated for multiple releases now. * Merge `_IndividualSpecifier` and `Specifier` This also eliminates the `_IndividualSpecifier.prereleases`, which is no longer used. * Drop `_require_version_compare` This enforced that a `LegacyVersion` could not match a `Specifier`. Since `LegacyVersion` is no longer a thing, this check is no longer necessary. * Factor out `_coerce_version` and use it to simplify a loop This makes the loop easier to understand. Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
205 additions
and
916 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.