-
Notifications
You must be signed in to change notification settings - Fork 96
Fix #241: Implement tilde and caret matching #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
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 |
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
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?