c4urself / bump2version

Version-bump your software with a single command
https://pypi.python.org/pypi/bump2version
MIT License
1.06k stars 134 forks source link

Need a --force option #131

Open ederag opened 4 years ago

ederag commented 4 years ago

Thanks for bumpversion, usually works great.

Trying to create a beta version for hamster.

$ bump2version --new-version 3.0-beta
bumpversion: error: the following arguments are required: part

Cryptic error message at first, but from #45, it is because the beta is not handled by my regexps, so --new-version role is only to bypass the automatic increment stuff.

A --force option would be useful here, to release right now, and think later about a regexp fix, or just leave it at that, as releasing a beta version is exceptional for hamster.

[Edit] Summary of the request: When --new-version is used, the new version should be exactly the one provided. No smart heuristics (they break too often). An error when the new version is not compatible with the regex would be fine. But then a --force option would allow to bypass this check and proceed.

florisla commented 4 years ago

The error message is in fact correct: bumpversion requires you to specify a [part], even when it's not needed. See #22.

So this would be more correct

bump2version bogus_part --new-version 3.0-beta

To me it feels weird to use a version number that your own regex is disallowing, but let's see if other people find this useful.

ederag commented 4 years ago

Agreed, it should have been "cryptic at first", edited now. That was the feeling of a new user who mistakenly thought that new-version allowed a full override. After reading #45, the error message made perfect sense.

So this would be more correct bump2version bogus_part --new-version 3.0-beta

How would that be "more correct" ? But I might have wrong preconceptions about the workings of bumpversion, even after reading the doc.

To me it feels weird to use a version number that your own regex is disallowing

Why wouldn't it be possible to use bumpversion as a smart "search&replace" with file/locations limitations to prevent any wrong replacements ? Especially as a temporary measure.

florisla commented 4 years ago

The command is "more correct" in the sense that bumpversion expects a part argument, and by listing bogus_part you are in fact supplying that. See #22 .

If you supply bogus_part, you'd get a different error message.

ederag commented 4 years ago

OK, thanks for the answer, that makes some sense now. Of course the proposition summary added to the OP makes even more sense to me :wink: I really like your gauging-interest tag, curious to see the result.