peritus / bumpversion

Version-bump your software with a single command
https://pypi.python.org/pypi/bumpversion
MIT License
1.5k stars 148 forks source link

First time using bumpversion with .cfg file requires --new-version #170

Open ben-hearn-sb opened 6 years ago

ben-hearn-sb commented 6 years ago

Hello,

The first time I use bumpversion on a module it appears that the --new-version flag is required even though I have a .cfg file present.

After the first bump I can run without, so my workflow looks like this essentially:

First time bumping: bumpversion --new-version 0.02 patch

Second - nth time bumping: bumpversion patch

Is this a bug or am I using the tool incorrectly?

// Ben

wrobell commented 6 years ago

I have similar problem.

By mistake I had in my setup.cfg file

[bumpversion]                                                                                                          
version = 0.13.0                                                                                                       
commit = 0                                                                                                             
tag = 0 

Then

$ bumpversion --allow-dirty minor
usage: bumpversion [-h] [--config-file FILE] [--verbose] [--list]
                   [--allow-dirty] [--parse REGEX] [--serialize FORMAT]
                   [--search SEARCH] [--replace REPLACE]
                   [--current-version VERSION] [--dry-run] --new-version
                   VERSION [--commit | --no-commit] [--tag | --no-tag]
                   [--tag-name TAG_NAME] [--message COMMIT_MSG]
                   part [file [file ...]]
bumpversion: error: the following arguments are required: --new-version

Once I changed version = ... to current_version = ... everything worked like expected.