Skip to content

Conversation

@bearomorphism
Copy link
Collaborator

…and, remove type alias

Closes #1678, #1679

Manually tested and added test cases, the result LGTM.

@bearomorphism
Copy link
Collaborator Author

@Lee-W I already ran pytest tests/commands/test_version_command.py -n auto --regen-all to regenerate the test files, but the pipeline still fails. (The tests passed on my machine)

Do you have any ideas why this happen

version = f"{version_scheme.minor}"
out.write(version.major)
return
if self.arguments.get("minor"):
Copy link
Member

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.

@woile
Copy link
Member

woile commented Dec 12, 2025

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",
Copy link
Member

@woile woile Dec 12, 2025

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):
Copy link
Member

@woile woile Dec 12, 2025

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"):
Copy link
Member

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

@woile
Copy link
Member

woile commented Dec 12, 2025

Nice to see this going forward 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants