Add an easy way to maintain PEP 440 compatible version identifiers
See original GitHub issuePEP 440 defines a new scheme for identifying versions of Python software distributions. bumpversion should offer an easy way to maintain all kinds of version identifiers supported by PEP 440.
Example
If I want to use “dev” releases to allow my users to download development releases from PyPI I have to use the following bumpversion configuration:
[bumpversion]
files = setup.py docs/conf.py
commit = True
current_version = 0.2.0.dev0
parse =
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?:\.dev(?P<dev>\d+))?
serialize =
{major}.{minor}.{patch}.dev{dev}
{major}.{minor}.{patch}
[bumpversion:part:dev]
values =
0
1
2
3
4
optional_value = 4
After releasing 0.1.2
users can execute bumpversion minor
and will move the version to 0.2.0.dev0
which is fine.
But to have no “dev” release at all or to stop doing “dev” releases optional_value
has to be set manually to the value of the release to be skipped. So I would appreciate it if users could use an option to move from 0.2.0.dev0 to 0.2.0.
Currently I have no idea how options for this behaviour could look like.
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (6 by maintainers)
Top GitHub Comments
@keimlink: I realise this issue is closed, but I had the same problem as you and solved it slightly differently, by adding a
dev
part (with no special configuration) and also arelease
part (like bumpversion’s own). Perhaps somebody will find this useful.Using the
release
part removes the problem of needing to define an endpoint fordev
. So, from this starting point:bumpversion patch
:0.1.0
->0.1.1.dev0
bumpversion release
:0.1.1.dev0
->0.1.1
bumpversion minor
:0.1.1
->0.2.0.dev0
bumpversion dev
:0.2.0.dev0
->0.2.0.dev1
bumpversion release
:0.2.0.dev1
->0.2.0
(I would combine
tag = False
in the config with usingbumpversion --tag release
, to prevent tagging all the non-release versions.)It’s actually a duplicate of #50, not 55.