mbarkhau / bumpver

BumpVer: Automatic Versioning
https://github.com/mbarkhau/bumpver
MIT License
199 stars 36 forks source link

how to add `v` prefix to tags? #189

Closed tandav closed 2 years ago

tandav commented 2 years ago

Here's my setup.cfg config:

[bumpver]
current_version = "1.3.5"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
commit = True
tag = True

[bumpver:file_patterns]
setup.cfg =
    version = {version}
    current_version = "{version}"
musictool/__init__.py =
    __version__ = '{version}'

when I run update it creates 1.3.6 tag. Is it possible to create v1.3.6 tag (but use 1.3.6 everywhere else - __init__.py, setup.cfg)

$ bumpver update --no-fetch --patch
INFO    - Old Version: 1.3.5
INFO    - New Version: 1.3.6
INFO    - git commit --message 'bump version 1.3.5 -> 1.3.6'
INFO    - git tag --annotate 1.3.6 --message 1.3.6

UPD: I solved how to do it:

[bumpver]
current_version = "v1.3.5"
version_pattern = "vMAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
commit = True
tag = True

[bumpver:file_patterns]
setup.cfg =
    version = {pep440_version}
    current_version = "{version}"
musictool/__init__.py =
    __version__ = '{pep440_version}'