Implement SemanticVersionRange to handle ranges #181
Closed
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.
It builds on the pip Requirement and Specifier classes to deal with version ranges, determining whether a given version is part of it and handling how a set of version specifiers should be updated according to the latest detected version.
Fixes #141
There's a minor regression, in the sense that non-contiguous version ranges are no longer supported without using
!=
to specify the non-inclusive versions.This means a version range like
<2,>=3
is not allowed, instead one should do:!=2.*
.The change is due to the way the version ranges is implemented - only a single upper and lower bound is allowed per version specifier set. For the disallowed specifier set in the example above there are indeed two distinct ranges: One from v0 to immediately prior to v2, and then another from v3 to infinity. Whereas for the allowed specifier set (which results in the same actual version range) there is only a single lower and upper bound: v0 and infinity, respectively.
In order to be ready for review the following is needed: