Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

"cz bump" update all verions with the same version as the project version #1205

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

Closed
aidin-zadeh opened this issue Aug 9, 2024 · 4 comments
Closed

Comments

@aidin-zadeh
Copy link

aidin-zadeh commented Aug 9, 2024

Description

The cz bump command to increment the version of the python poetry package, would automatically updates all version strings in the pyproject.toml file. This includes the version numbers of all dependencies, which can be problematic if you have complex dependencies and you don't want their versions to be updated.

If you use inline-table or standard-table syntax to specify package dependencies in pyproject.toml, you have to set the expected version using the 'version' property. If you run 'cz bump', it will also update these versions, which may not be what you want.

Steps to reproduce

  1. poetry dependencies with complex specifications:
[tool.poetry.dependencies]
python = "^3.11.0"
my_dep = {version = "^1.0.0", source = "my-soruce"}

[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$version"
version_scheme = "pep440"
version_provider = "poetry"
update_changelog_on_bump = false
changelog_incremental = false
version_files = [
    "my_package/__init__.py",
    "pyproject.toml:version"
]
  1. cz bump

Current behavior

Incrementing the version of a Python package with complex dependencies using the 'version' property can inadvertently update the version of package dependencies, which may not be the intended outcome.

Desired behavior

cz bump should only bump the package version only. Or add support to temporarily disable bumping for a given code line/table/block.

Screenshots

No response

Environment

cz version: 3.28.0
Python: 3.11.8
OS: Darwin

@Lee-W Lee-W changed the title Good bug title tells us about precise symptom, not about the root cause. "cz bump" update all verions with the same version as the projceet version Aug 11, 2024
@Lee-W Lee-W changed the title "cz bump" update all verions with the same version as the projceet version "cz bump" update all verions with the same version as the project version Aug 11, 2024
@Lee-W
Copy link
Member

Lee-W commented Aug 11, 2024

This is expected for now. The workaround is changing "pyproject.toml:version" to regular expression that matches only the project version.

@Lee-W
Copy link
Member

Lee-W commented Aug 11, 2024

This is something we can improve if anyone has an idea or add least something we can add to the doc

@Lee-W
Copy link
Member

Lee-W commented Aug 11, 2024

mark it as type: documentation for now unless we got a good solution

@Lee-W
Copy link
Member

Lee-W commented Aug 11, 2024

Just noticed there's already an existing issue #819 and the workaround #496 (comment)

@Lee-W Lee-W closed this as completed Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants