peritus / bumpversion

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

Short version of "dry run" option yields an error #88

Closed justinmayer closed 8 years ago

justinmayer commented 9 years ago

When I run bumpversion 0.5.3 on Python 2.7.10:

bumpversion -n --verbose --current-version 3.5.0 minor setup.py

... the output includes...

Attempting to increment part '-n'

... and the command fails with an error:

Traceback (most recent call last):
File "/virtualenvs/pelican/bin/bumpversion", line 11, in <module>
    sys.exit(main())
File "/virtualenvs/pelican/lib/python2.7/site-packages/bumpversion/__init__.py", line 912, in main
    f.should_contain_version(current_version, context)
File "/virtualenvs/pelican/lib/python2.7/site-packages/bumpversion/__init__.py", line 202, in should_contain_version
    if self.contains(serialized_version):
File "/virtualenvs/pelican/lib/python2.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: 'minor'

If, on the other hand, I use the longer form of the dry-run option instead of -n, the command completes as expected, and there is no error:

bumpversion --dry-run --verbose --current-version 3.5.0 minor setup.py
peritus commented 9 years ago

Good catch, there seems to be some discrepancy between the two forms.

Want to submit a pull request (or a regression test or both) ?

justinmayer commented 9 years ago

I came across this error while I was experimenting with Bumpversion last week when preparing to release Pelican 3.6. During that evaluation I realized that there are a few steps that Bumpversion doesn't seem to handle (removing .dev suffix before incrementing, updating changelog, adding back .dev suffix for the next development cycle, etc).

So I decided to give Bumpr another try, despite the lack of development activity there, and it handled the various Pelican release steps with aplomb.

This is a rather long-winded way of saying that since we're using Bumpr for Pelican right now, I don't think I'll have the time to submit a pull request to address this Bumpversion issue. Hope you can relate. (^_^)

peritus commented 9 years ago

removing .dev suffix before incrementing adding back .dev suffix for the next development cycle

That's how I use bumpversion for bumpversion itself:

updating changelog

That's probably outside of the scope of bumpversion and there's lots of great software out there doing just that.

Hope you can relate. (^_^)

I sure can :)

I'll keep this open to address this in a quiet hour. Thanks again for the report!

justinmayer commented 9 years ago

Ahh, I see. I figured I was missing something. I'll keep a watchful eye on Bumpversion and may come back to it. (^_^)

Thanks for all your work on what appears to be a very useful and popular tool. Bravo!

peritus commented 8 years ago

Fixed by @inirudebwoy in 6ec908f018a827bfae94ed50baf241461eba7bcb.