peritus / bumpversion

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

Missing allowed 'part' values in commandline help #200

Open kamichal opened 5 years ago

kamichal commented 5 years ago

Help formed by argparse (bumpversion --help) does not tell what are allowed values for part argument. I mean the 'major', 'minor' and 'patch' (most probably, I believe) . The help should provide at least minimalistic knowledge required to run given script. In my case - I knew that there is nice "bumpversion" script but forgot how to call it. I got disappointed trying to find it in the help. I had to run a browser and google for manual, which is insane, because even the README.rst of this project does not list the allowed values.

patrickbucher commented 2 years ago

I had the same issue. I used bumpversion bugfix instead of bumpversion patch, and the result is that I have a scrambled version in setup.py:

version = 'version = '1.0.0''

And a big error message:

$ bumpversion bugfix
fatal: tag 'v1.0.0' already exists
Traceback (most recent call last):
  File "/home/patrick/bumpversion-example/env/bin/bumpversion", line 8, in <module>
    sys.exit(main())
  File "/home/patrick/bumpversion-example/env/lib/python3.10/site-packages/bumpversion/cli.py", line 137, in main
    _tag_in_vcs(vcs, context, args)
  File "/home/patrick/bumpversion-example/env/lib/python3.10/site-packages/bumpversion/cli.py", line 728, in _tag_in_vcs
    vcs.tag(sign_tags, tag_name, tag_message)
  File "/home/patrick/bumpversion-example/env/lib/python3.10/site-packages/bumpversion/vcs.py", line 138, in tag
    subprocess.check_output(command)
  File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'tag', 'v1.0.0', '--message', 'Bump version: 1.0.0 → 1.0.0']' returned non-zero exit status 128.
mgrazebrook commented 2 years ago

I agree - especially since most people will use them. But please also update the documentation - I had trouble confirming that the name 'patch' was what I wanted. It's in there, but buried, and as a newb it was pretty much the first thing I wanted.