mtkennerly / dunamai

Dynamic versioning library and CLI
https://dunamai.readthedocs.io/en/latest
MIT License
320 stars 23 forks source link

add 'bump_complete_version' which allows bumping revisions as well #38

Closed marnikow closed 2 years ago

marnikow commented 2 years ago

I wanted to use dunamai in my next project but missed some features. Cause I didn't want to overload one pull request I've split each feature into their own pull request.

In this pull request I propose to add a function that allow bumping revisions as well.

mtkennerly commented 2 years ago

Thanks for the PR and for splitting it up :)

You can currently do this with version.serialize(bump=True), which does bump the revision if it's set, along with some other handling. Does that satisfy your use case?

marnikow commented 2 years ago

Bumping a version without having to serialise it would stil be a plus for me.

mtkennerly commented 2 years ago

Hmm, I'm not necessarily opposed to adding a bump() method to the Version class, but I'm still a bit unclear on the use case. At the point where you would call serialize(), is the code no longer aware of the need to bump? When do you need to bump without serializing?

marnikow commented 2 years ago

I can't come up with a use case but would still find it a puls if there would be a bump function that also bumps the revision next to the normal bump function

marnikow commented 2 years ago

Hi Matthew

Do you have a timeline when you would release the new features as a new version?

Thanks in advance

mtkennerly commented 2 years ago

@marnikow Sorry about the delay! I'll finish looking over your PRs and getting a release out this week.

mtkennerly commented 2 years ago

I just thought of a use case: Version.serialize() doesn't let you specify the index to bump, so you could use this new function first to accomplish that. Technically, the bump argument could be overloaded to take an int, but I don't really like that, and it'd get messy if there were more arguments in the future. I'm happy to add this to support that use case - I'll just turn it into a method after the merge. Thanks!

marnikow commented 2 years ago

Thanks for the work!