Fix #241: Implement tilde and caret matching#367
Draft
tomschr wants to merge 10 commits intopython-semver:masterfrom
Draft
Fix #241: Implement tilde and caret matching#367tomschr wants to merge 10 commits intopython-semver:masterfrom
tomschr wants to merge 10 commits intopython-semver:masterfrom
Conversation
Contributor
|
My specific use-case was an event processor that routed messages based on their semver number, so for example, everything matching However, I will say that I really don't like operator overloading and much prefer a |
Member
Author
Yeah, that's also one of the questions where I'm unsure about that. 🤔 |
507b641 to
ac78ab2
Compare
5d9f68e to
a22b1ab
Compare
a22b1ab to
017bc0b
Compare
017bc0b to
3f20784
Compare
11d5668 to
4497769
Compare
4497769 to
d9591b6
Compare
d9591b6 to
b577366
Compare
Use parts of PEP 440
* Introduce Spec class to deal with such comparisons * Improve documentation * Simplify code in Version.match (delegates to Spec.match)
* Rename _MAJOR, _MINOR, _PATCH, _PRERELEASE, and _BUILD and remove the "_" prefix * Change _REGEX, _REGEX_TEMPLATE, and _REGEX_OPTIONAL_MINOR_AND_PATCH and remove the "_" prefix
From Version to VersionRegex
* Remove unused Int_or_Str type * Reuse String in SpecComparable
b577366 to
a81ee96
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.
Specclass to deal with such comparisonsVersion.match(delegates toSpec.match)Implementation Questions
Specclass the right approach here? Any other options?Spec.match? What aboutVersion.match?VersionRegexclass a good idea? It shares some constant regexes betweenVersionandSpec. Or should we better use just variables and share those?Specclass supports operators likeSpec("1.*") == Version(1, 2, 3). I'm wondering if this is useful as we can't use the same for~and^. If we remove operators, the code gets a bit smaller, but then we have to callSpec.match. Good, bad?SpecSetclass to support extended ranges like<=1.2.3 || >=2.3.4. Any design decisions that should be implemented in regards to this?