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

Serialize not falling to lowest viable serialization #246

Open
ankurt opened this issue Mar 24, 2022 · 0 comments
Open

Serialize not falling to lowest viable serialization #246

ankurt opened this issue Mar 24, 2022 · 0 comments

Comments

@ankurt
Copy link

ankurt commented Mar 24, 2022

Hi,

I'm currently on bump2version = "^1.0.1"

Description

The serialize variable in the config is not falling to the lowest acceptable pattern.

Reproduce:

My config is below:

[bumpversion]
current_version = 0.0.0b2
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>[a-z]+)(?P<build>\d+))?
serialize = 
	{major}.{minor}.{patch}{release}{build}
	{major}.{minor}.{patch}
commit = True
tag = False

[bumpversion:part:release]
optional_value = g
values = 
	a
	b
	g

[bumpversion:part:build]

[bumpversion:file:core/__init__.py]

[bumpversion:file:.version]

[bumpversion:file:pyproject.toml]

When I run:

bumpversion release --dry-run

I expect 0.0.0b2 to fall through the first serialization to the second and give me => 0.0.0 since release g is marked optional and the 0 should be marked optional by default for build.

Instead I get 0.0.0b2 => 0.0.0g0

When I flip the serialize order on this particular bump it actually works. However the next bump of release fails since it does not drop to the serialize pattern below it (this in particular was expected. I was trying to debug where the issue is). So this indicates to me that the issue is not with the default optional value of 0 on build.

However, when I run:

bumpversion release --dry-run --verbose --serialize {major}.{minor}.{patch}

I get what I want.

Unfortunately, when I ran this without --dry-run, the serialization was set to 0.0.0 in the bumpversion config, but not in any of the additional files set in the config. So I got a mismatch of 0.0.0 in the config, and then 0.0.0g0 in the other files.

I think there are potentially two separate issues here. Happy to separate them if that's easier:

  1. --serialize settings don't propagate to the files in the bump config. Looks like an issue for this already exists.
  2. the serialize variable in the config is not falling to the lowest setting.
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