-
Notifications
You must be signed in to change notification settings - Fork 24
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
⭐ epoch support in version #5106
Conversation
bb28b92
to
ef4f6db
Compare
Test Results3 317 tests +27 3 313 ✅ +27 1m 40s ⏱️ -12s Results for commit 1ab8c5c. ± Comparison against base commit be323a1. This pull request removes 8 and adds 35 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Update after discussion with @chris-rock: > version("1.2.3")
> version("1.2.3", type="semver")
> version("1.2.3").inRange(">=1.0.0", "<2.0.0")
> version("1.2.3").inRange("1.0.0", "2.0.0") # ==> >=1.0.0 <=2.0.0 Introduce |
ef4f6db
to
0f080e2
Compare
Add support for epochs in MQL's `semver` type. ```mql > semver("1:1.2.3") < semver("2:1.0.0") true ``` This works for both deb/rpm-style epochs ("NN:version") and python-style epochs ([PEP440](https://peps.python.org/pep-0440/)). Additionally you can access the epoch: ```mql > semver("5:1.2.3").epoch 5 > semver("3!2.1").epoch 3 ``` You can compare versions with and without epochs as well: ```mql > semver("1:1.0") > semver("2009.12.03") true ``` Note: Technically epochs aren't semver, so the name `semver` is hitting its limit here. We could introduce the `version` type as a replacement or as a temporary holdover (because we also don't want to clutter the global namespace too much). Internal note: This required a new wrapper around the version, which can now be extended with more metadata. Currently we have the epoch stored. Signed-off-by: Dominik Richter <[email protected]>
The soft part of this deprecation is that we don't show a deprecation warning anywhere at all. So semver is still technically included, since we released it in v9.x, but we will deprecate it formally with the next major release.
0f080e2
to
1ab8c5c
Compare
Planning on 2 follow-ups:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @arlimus Great improvement.
Add support for epochs in MQL's
semver
type.This works for both deb/rpm-style epochs ("NN:version") and python-style epochs (PEP440).
Additionally you can access the epoch:
You can compare versions with and without epochs as well:
Internal note: This required a new wrapper around the version, which can now be extended with more metadata. Currently we have the epoch stored.