c4urself / bump2version

Version-bump your software with a single command
https://pypi.python.org/pypi/bump2version
MIT License
1.06k stars 134 forks source link

enhancement: pre-release support #29

Closed jeremycarroll closed 6 years ago

jeremycarroll commented 6 years ago

A release workflow we follow is:

A similar workflow would use -alpha, -beta, -gamma as the pre-release identifiers.

This is only currently supported by bump2version using the --new-version flag, but could be supported by --prerelease and --release flags. (I know, please submit a PR ... :))

jeremycarroll commented 6 years ago

This issue is misconceived. The current functionality supports the desired behavior e.g. with:

[bumpversion]
current_version = 0.3.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)([.](?P<release>[gr][ac])[.](?P<rc>\d+))?
serialize = 
    {major}.{minor}.{patch}.{release}.{rc}
    {major}.{minor}.{patch}

[bumpversion:file:setup.cfg]
search = version = {current_version}
replace = version = {new_version}

[bumpversion:file:syapse_ontology/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

[bumpversion:part:release]
optional_value = ga
values = 
    rc
    ga

[bumpversion:part:rc]
first_value = 1

Then bumpversion major|minor|patch increases the part and moves to rc.1 followed by a bumpversion rc to move to rc.2 (and then rc.3 etc), or a bumpversion release to drop the rc part entirely.