Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example of PEP-0440 versioning. #240

Open
jorgeecardona opened this issue Feb 19, 2022 · 0 comments
Open

Add an example of PEP-0440 versioning. #240

jorgeecardona opened this issue Feb 19, 2022 · 0 comments

Comments

@jorgeecardona
Copy link

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant