Closed
Description
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
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
woile commentedon 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 commentedon Nov 12, 2020
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 commentedon Nov 12, 2020
@woile PR created :)
woile commentedon Nov 14, 2020
Released on
2.7.0
🎉