bump2version icon indicating copy to clipboard operation
bump2version copied to clipboard

Add an example of PEP-0440 versioning.

Open jorgeecardona opened this issue 3 years ago • 0 comments

Hi, I expect most (some?) users of bump2version will push their packages to pypi and there is a recommendation of versioning in PEP-0440. It would be nice to have that in the documentation. It is more complex than the current default major.minor.patch, but I can imagine many of use wanting to have the more complex in PEP-0440.

For my purposes is enough to have this:

[bumpversion]
current_version = 0.1
tag = True
commit = True
parse = (?P<major>\d+)\.(?P<minor>\d+)((?P<release>a|b|rc)(?P<build>\d+))?
serialize = 
	{major}.{minor}{release}{build}
	{major}.{minor}
	{major}

[bumpversion:part:release]
optional_value = r
values = 
	a
	b
	rc
	r

[bumpversion:part:build]
first_value = 1

I can add this to the docs or improve on this, to have the full PEP-0440 scheme if people are willing to suggest improvements or find errors in my config (I haven't try all the corners but it seems to work as desired so far.)

jorgeecardona avatar Feb 19 '22 23:02 jorgeecardona