Skip to content

Support bumping local version #302

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

Closed
marcossantiago opened this issue Nov 12, 2020 · 4 comments
Closed

Support bumping local version #302

marcossantiago opened this issue Nov 12, 2020 · 4 comments
Labels
type: feature A new enhacement proposal

Comments

@marcossantiago
Copy link
Contributor

marcossantiago commented Nov 12, 2020

Description

I am working on some projects where the version is a combination of the a public api version + our local version.

Example: 5.3.1+1.0.0.

So when we bump we actually wants to bump only the local version like 5.3.1+1.0.0 -> 5.3.1+1.1.0, but cz completely ignores the local version and only bumps the first release like:

➜ cz bump --files-only --yes
bump: version 5.3.1+0.9.0 → 5.4.0

This does seems like would be a breaking change though...

Possible Solution

A possible solution would be to modify the semver_generator() to check if the local version complies with semver and bump the local version instead. The method would return the entire version like 5.3.1+1.1.0.

>>> from packaging.version import Version
>>> a = Version("5.3.1+1.0.0")
>>> a.base_version
'5.3.1'
>>> a.local
'1.0.0'
>>> b.base_version
'1.0.0'
>>> b.release
(1, 0, 0)

If you accept, I will be happy to create a PR with the changes.

Additional context

References: Python 440 Local version

@marcossantiago marcossantiago added the type: feature A new enhacement proposal label Nov 12, 2020
@woile
Copy link
Member

woile commented Nov 12, 2020

Seems related to #150
It doesn't necessarily have to be a breaking change, what if a flag is used --local-version? would it be breaking?
If you want you can share a PR and we can discuss it there.

@marcossantiago
Copy link
Contributor Author

That would be great. I will create a PR passing the flag --local-version, once you're okay I will also commit the tests.

@marcossantiago
Copy link
Contributor Author

@woile PR created :)

@woile
Copy link
Member

woile commented Nov 14, 2020

Released on 2.7.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new enhacement proposal
Projects
None yet
Development

No branches or pull requests

2 participants