peritus / bumpversion

Version-bump your software with a single command
https://pypi.python.org/pypi/bumpversion
MIT License
1.5k stars 148 forks source link

Dependencies versions in pyproject.toml altered casually #220

Open Tammura opened 3 months ago

Tammura commented 3 months ago

Hi all,

I've encountered an issue twice while using the CLI to release a new patch with the bumpversion patch pyproject.toml command. It seems that this command not only updates the project version but also inadvertently changes the versions of project dependencies.

Before running cli command:

# pyproject.toml
[build-system]
requires = ["setuptools>=61.0.1", "wheel"]

dependencies = [
    "python-dotenv>=1.0.1",
    ...
]

[tool.bumpver]
current_version = "1.0.1"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
tag_message = "{new_version}"
tag_scope = "default"
commit = true
tag = true
push = false
...
#.bumpversion.cfg
[bumpversion]
current_version = 1.0.1
commit = True
tag = True
tag_name = {new_version}

After command execution: bumpversion patch pyproject.toml

# pyproject.toml
[build-system]
requires = ["setuptools>=61.0.2", "wheel"] # setuptools version updated to 61.0.2

dependencies = [
    "python-dotenv>=1.0.2", # python-dotenv version updated to 1.0.2
    ...
]

[tool.bumpver]
current_version = "1.0.2"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
tag_message = "{new_version}"
tag_scope = "default"
commit = true
tag = true
push = false
...
#.bumpversion.cfg
[bumpversion]
current_version = 1.0.2
commit = True
tag = True
tag_name = {new_version}

Anyone facing the same problem? Any idea on how to fix it? Thanks!