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

is there a way so that 2 formats coexist? #153

Open dpinol opened 7 years ago

dpinol commented 7 years ago

I'd like to have a M.m.b(_RCX) format for releases and RCs, and a format DEV-ticket-SNAPSHOT for snapshots. Obviously to switch between one and the other format I'd need to do --new-version

The parsing is ok if I do: parse = ((?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)-?(?P<release>.*))|(DEV-(?P<ticket>\d+)-SNAPSHOT)

But for the serialization part, it force the first format found in the list, even if I do "--new-version". So with this I get DEV-0-SNAPSHOT when I do --new-version 2.5.3. Curiously, it correctly changes the version to 2.5.3 on .bumpversion, but not on my other files.

serialize =
        DEV-{ticket}-SNAPSHOT
        {major}.{minor}.{patch}-{release}
        {major}.{minor}.{patch}

And with this I get 0.0.0-gamma when I do --new-version DEV-999-SNAPSHOT. Again, it correctly changes the version to DEV-999-SNAPSHOT on .bumpversion, but not on my other files.

serialize =
        {major}.{minor}.{patch}-{release}
        {major}.{minor}.{patch}
        DEV-{ticket}-SNAPSHOT

thanks!