c4urself / bump2version

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

Using bump2version with pyproject.toml bumps gunicorn version in dependencies #219

Closed nadworny closed 3 years ago

nadworny commented 3 years ago

 Problem

We've been using the following command for quite a while without issues: bump2version minor pyproject.toml

Unfortunately, after adding a gunicorn dependency to poetry, the above command also bumps the version of gunicorn for some reason.

Before:

[tool.poetry]
name = "test"
version = "0.1.0"

[tool.poetry.dependencies]
python = "^3.8"
fastapi = "^0.63.0"
gunicorn = "^20.1.0"

After command:

[tool.poetry]
name = "test"
version = "0.2.0"

[tool.poetry.dependencies]
python = "^3.8"
fastapi = "^0.63.0"
gunicorn = "^20.2.0"

Environment

Python: 3.9.4 bump2version: 1.0.1

hukkin commented 3 years ago

This is by design. The default is to search and replace anything that matches the current version, and the end part of the gunicorn version does match 0.1.0.

You probably want to configure a stricter search and replace pattern in .bumpversion.cfg. E.g.

[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
florisla commented 3 years ago

@nadworny Does this suggestion work for you?

nadworny commented 3 years ago

Yes thanks a lot👍