-
-
Notifications
You must be signed in to change notification settings - Fork 304
feat(version): add MANUAL_VERSION, --next and --patch to version comm… #1724
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: v4-11-0
Are you sure you want to change the base?
feat(version): add MANUAL_VERSION, --next and --patch to version comm… #1724
Conversation
…and, remove type alias
|
@Lee-W I already ran Do you have any ideas why this happen |
| version = f"{version_scheme.minor}" | ||
| out.write(version.major) | ||
| return | ||
| if self.arguments.get("minor"): |
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.
I realize now that this creates problems with the (not)monotonic kind of versions (and possible non-semver). I'm not sure what to do about it.
I think for now it's fine that if you diverge too much from semver in your custom version scheme, then you won't get the full range of features.
|
There was a way to run all the pre-commits, but I don't remember how it works 😅 |
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "next_version, current_version, expected_version", |
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.
maybe rename next_version to next_increment?
In the user facing cli, it makes sense semantically: --next=MAJOR (give me the next major).
| assert expected_version in captured.out | ||
|
|
||
|
|
||
| def test_next_version_invalid_version(config, capsys): |
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.
what about having a parametrize of the combinations that should fail:
@pytest.mark.parametrize(
"args",
[
# incomplete list:
{"next"},
# ...
{"--verbose", "next"}
]
)| out.error("Invalid version.") | ||
| return | ||
|
|
||
| if next_str := self.arguments.get("next"): |
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.
what would happen here if I run cz version --project --next? I would expect that to work
|
Nice to see this going forward 🎉 |
…and, remove type alias
Closes #1678, #1679
Manually tested and added test cases, the result LGTM.