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

Expose major/minor/patch and custom parts in all configurable strings #41

Merged
merged 8 commits into from
Aug 25, 2019

Conversation

florisla
Copy link
Collaborator

@florisla florisla commented Oct 31, 2018

Closes #35

Currently, only serialize has access to the part identifiers such
as {major}, {minor} and {patch}.

This change exposes them also to other configurable strings, providing
more flexibility in formatting:

message
tag_name
tag_message
replace

To be intuitive relative to the existing current_version
and new_version identifiers, these are named current_[part]
and new_[part].

Additionally, to be intuitive relative to the [part] identifiers
available in serialize, the new_[part] identifiers are also
exposed as [part] without the new_ prefix.

@florisla
Copy link
Collaborator Author

@c4urself How do you feel about this one?

If it has no chance to be merged in, I should stop using it here ;-)

@c4urself
Copy link
Owner

c4urself commented Nov 18, 2018

@florisla -- I like it, haven't had a need for it myself but definitely see why some others might. Can we add a test for the replace functionality you were planning on using it for?

@florisla
Copy link
Collaborator Author

florisla commented Nov 19, 2018

It seems the tests (edit: i.e., all test_cli.py tests) are not compatible to pytest 4.0.0. On 3.10.1 it passes with deprecation warnings.

@lycantropos
Copy link

lycantropos commented Dec 7, 2018

If I understood correctly this will allow us to handle cases like

https://cmake.org/files/v3.9/cmake-3.9.5.tar.gz

which after bumping minor version becomes

https://cmake.org/files/v3.10/cmake-3.10.0.tar.gz

?

@florisla
Copy link
Collaborator Author

florisla commented Dec 7, 2018

If you have a special bumpversion configuration file to track the cmake version, yes.

You can use the parts (major/minor/patch or custom) independently everywhere you like. So you could also create a commit message like

Move to cmake major version "3", minor "10", patch "0" from 3/9/5

@florisla
Copy link
Collaborator Author

florisla commented Dec 7, 2018

I've just rebased on #46 so the unit tests now use 'vcs' as a fixture.

@florisla
Copy link
Collaborator Author

Rebased on master.

Let me know if you'd like to see other changes.

bumpversion/__init__.py Outdated Show resolved Hide resolved
florisla added a commit to florisla/bump2version that referenced this pull request Dec 18, 2018
In search/replace, always use current_[part] or new_[part].
See discussion at c4urself#41 (comment)

Does not affect pytest tests.
@florisla
Copy link
Collaborator Author

florisla commented Jan 9, 2019

Rebased on master.

@florisla
Copy link
Collaborator Author

I've rebased on master and updated the Readme to reflect the changes (+ some cosmetic fixes).

@andrew-glenn
Copy link

@c4urself - any chance this can be merged? :)

florisla and others added 8 commits August 24, 2019 18:04
Currently, only 'serialize' has access to the 'part' identifiers such
as {major}, {minor} and {patch}.

This change exposes them also to other configurable strings,
providing more flexibility in formatting:
  message
  tag_name
  tag_message
  replace

To be intuitive relative to the existing 'current_version'
and 'new_version' identifiers, these are named 'current_[part]'
and 'new_[part]'.
@c4urself c4urself merged commit 2bd80e8 into c4urself:master Aug 25, 2019
@florisla florisla deleted the expose-parts-everywhere branch September 7, 2019 13:10
@florisla florisla added this to the v1.0.0 milestone Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose parts (major/minor/patch/...) in 'replace' too
5 participants