c4urself / bump2version

Version-bump your software with a single command
https://pypi.python.org/pypi/bump2version
MIT License
1.06k stars 134 forks source link

{new_version} not available in search #136

Closed chfast closed 3 years ago

chfast commented 4 years ago

This config does not work, I get KeyError of "new_version".

search = {new_version}

It is also unclear if parsing/serializing is done for every file individually or if the result values are taken from main config if parse and serialize sections are not present in [file] section.

Why this can be useful?

search = {new_version} - unreleased
replace = {new_version} - {utcnow:%Y-%m-%d}
florisla commented 4 years ago

You have to search for current_version, not new_version.

If you don't specify parse or serialize for a file then those settings are taken from the main configuration.

chfast commented 4 years ago

You have to search for current_version, not new_version.

I want to search for {new_version} as stated.

florisla commented 4 years ago

That's not possible... The new_version is not yet known at that point.

First, current_version is searched and only then is this used to calculate new_version.

florisla commented 4 years ago

To clarify, searching current_version is done for all files, and bumpversion enforces that all the files have the same version number.

florisla commented 3 years ago

I'm going to classify this as an unsupported use case.