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

bumpversion fails if mercurial isn't installed #127

Open hodur opened 8 years ago

hodur commented 8 years ago

I have bumpversion 0.5.3 running on linux mint 17 (which uses ubuntu 14.04.3). Every time I run bumpversion I get this error:

Traceback (most recent call last): File "/home/hodur/work/test/bumpversiontest/env/bin/bumpversion", line 11, in sys.exit(main()) File "/home/hodur/work/test/bumpversiontest/env/lib/python3.4/site-packages/bumpversion/init.py", line 659, in main if vcs.is_usable(): File "/home/hodur/work/test/bumpversiontest/env/lib/python3.4/site-packages/bumpversion/init.py", line 83, in is_usable stdout=subprocess.PIPE File "/usr/lib/python3.4/subprocess.py", line 537, in call with Popen(_popenargs, *_kwargs) as p: File "/usr/lib/python3.4/subprocess.py", line 859, in init restore_signals, start_new_session) File "/usr/lib/python3.4/subprocess.py", line 1457, in _execute_child raise child_exception_type(errno_num, err_msg) NotADirectoryError: [Errno 20] Not a directory

If I install mercurial everything works as expected. I noticed that you're checking whether errno equals 2 when you expect to catch this exception for this specific case. Is that a typo or does either windows or osx result in an exception with errno 2?

cafreeman commented 7 years ago

I get this exact same error on macOS with python 2:

Traceback (most recent call last):
  File "/usr/local/bin/bumpversion", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/bumpversion/__init__.py", line 658, in main
    if vcs.is_usable():
  File "/usr/local/lib/python2.7/site-packages/bumpversion/__init__.py", line 83, in is_usable
    stdout=subprocess.PIPE
  File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 168, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 20] Not a directory
KPrasch commented 2 years ago

I'm experiencing a similar issue

Python 3.9.7 Ubuntu 20.10

(venv) user@host:~/Git/nucypher$ bumpversion stage
Traceback (most recent call last):
  File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/bin/bumpversion", line 8, in <module>
    sys.exit(main())
  File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.9/site-packages/bumpversion/cli.py", line 83, in main
    vcs_info = _determine_vcs_usability()
  File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.9/site-packages/bumpversion/cli.py", line 230, in _determine_vcs_usability
    if vcs.is_usable():
  File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.9/site-packages/bumpversion/vcs.py", line 47, in is_usable
    subprocess.call(
  File "/usr/lib/python3.9/subprocess.py", line 349, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'hg'
aaronlelevier commented 1 year ago

Same error as above, not sure if this can be fixed with config? It is strange, because when running bumpversion to bump itself, I don't hit this error.