bumpversion
bumpversion copied to clipboard
Issues with using a config file specified part without command line part argument.
When I run the same command using --dry-run it executes without the part positional argument added.
Also running with --verbose option it works fine.
Sample command
bumpversion --allow-dirty --list --config-file /path/to/.bumpversion-local.cfg patch /path/to/setup.py
My sample config file
[bumpversion]
current_version = 1.0.21
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
serialize = {major}.{minor}.{patch}
commit = True
tag = False
message = "{now:%Y-%m-%d %H:%M} - Increased version: {current_version} to {new_version}"
[bumpversion:part:patch]
[bumpversion:file:/path/to/setup.py]
search = version="{current_version}"
Raises
Traceback (most recent call last):
File "/usr/local/bin/bumpversion", line 11, in <module>
sys.exit(main())
File "/Library/Python/2.7/site-packages/bumpversion/__init__.py", line 912, in main
f.should_contain_version(current_version, context)
File "/Library/Python/2.7/site-packages/bumpversion/__init__.py", line 202, in should_contain_version
if self.contains(serialized_version):
File "/Library/Python/2.7/site-packages/bumpversion/__init__.py", line 214, in contains
with io.open(self.path, 'rb') as f:
IOError: [Errno 2] No such file or directory: 'patch'
I ran into this problem too, and found that -n and --dry-run are not equivalent, even though the usage message says they should be:
--dry-run, -n Don't write any files, just pretend. (default: False)
With -n I get the error your report. With --dry-run it works as advertised. @jackton1 - Which are you using?