Simplfy the rules for > and <#25
Merged
Merged
Conversation
71891f4 to
b2b7e9b
Compare
|
lgtm |
b2b7e9b to
c821038
Compare
Instead of having these operators imply a !=.* this will instead have them more-or-less simply check if the prospective version is greater than or less than the specifier version. They will not however match a post or pre-release of the version mentioned in the specifier unless the specifier itself contains a post or a pre-release. In addition, we will ensure that >V does not match V+local.version even though it is techincally greater than V.
c821038 to
e61d0a3
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of having these operators imply a
!=V.*this will instead have them more-or-less simply check if the prospective version is greater than or less than the specifier version. They will not however match a post or pre-release of the version mentioned in the specifier unless the specifier itself contains a post or a pre-release. In addition, we will ensure that>Vdoes not matchV+local.versioneven though it is technically greater thanV.In particular that means that something like
>1.7will match1.7.1but will not match1.7.post1while>1.7.post0would. Likewise<3.0would not match3.0.dev0while<3.0rc1would.This PR also includes two new attributes on
Versioninstances:is_postreleaseto determine is a particular release is a post release andbase_versionwhich will return just the part of the version which shows the "base" version (e.g.1.0is the base version of1.0.dev0and1.0.post0and2!1.0is the base version of2!1.0.dev0and2!1.0.post0).This requires pypa/interoperability-peps#3 to land before this can be merged.