bumpversion icon indicating copy to clipboard operation
bumpversion copied to clipboard

Print valid cli arguments for [part] in usage string

Open twiecki opened this issue 10 years ago • 8 comments

I run:

bumpversion --config .bumpversion.cfg --new-version 0.5.2

My config:

[bumpversion]
files = README.rst docs/Makefile docs/make.py hddm/__init__.py
commit = True
tag = True
current_version = 0.5.2.beta

Which gives me the error msg:

 bumpversion: error: argument --new-version: expected one argument

I must be doing something obviously wrong but not sure what?

twiecki avatar Nov 12 '13 12:11 twiecki

Ok, that error is definitely misleading, sorry about that, I'll fix it.

However, you need to specify which part of the version to bump (in the standard configuration that's "major", "minor", "patch"), as in bumpversion [--options] patch to bump the last number.

peritus avatar Nov 12 '13 12:11 peritus

Because I see current_version = 0.5.2.beta in your config:

At the moment bumpversion doesn't support parts (that's what I call the individual digits that are combined to the version number) that don't contain a number, so current_version = 0.5.2.beta1 might work (see these two lines https://github.com/peritus/bumpversion/blob/d9ee20ecaee79e4ec38f0d7d6e24bf2c5c8ca3a5/tests.py#L222-L223 on how a configuration for 5-part version might look like).

I'm interested in your workflow (is it 0.5.1 -> 0.5.2.beta -> 0.5.2 -> ... ?) and to make it work in bumpversion, can you go into detail on that ?

peritus avatar Nov 12 '13 12:11 peritus

Also, --config .bumpversion.cfg is the default, so, unless you want to use another config file, it should be safe omit.

peritus avatar Nov 12 '13 12:11 peritus

Thanks for the prompt reply.

Yes, my workflow is 0.5.1 -> 0.5.2.beta -> 0.5.2.RC1 -> 0.5.2 -> ... Although now that I think of it I probably should be doing beta1.

Was patch required before? I suppose it's nice to just not specify the next version but just which part to bump.

twiecki avatar Nov 12 '13 13:11 twiecki

OK, I tried bumpversion --new-version 0.5.2 patch but that changed the version number to patch?

twiecki avatar Nov 12 '13 13:11 twiecki

Yes, I usually just use bumpversion patch alone, everything else is in the config file.

OK, I tried bumpversion --new-version 0.5.2 patch but that changed the version number to patch?

That is a bug then, I'll have to look into.

peritus avatar Nov 12 '13 13:11 peritus

I also think:

  part                  Part of the version to be bumped.

In the help docs should list which arguments are possible and their behavior.

I now tried bumpversion patch and it bumped 0.5.2.beta to 0.5.3.

twiecki avatar Nov 12 '13 14:11 twiecki

You're right, thanks! I'll get to that.

peritus avatar Nov 12 '13 14:11 peritus