-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
bump
is also changing dependency versions in pyproject.toml
, when the versions are the same
#496
Comments
May be related to PR #370 where this syntax was proposed version_files = [
"pyproject.toml:[tool.commitizen]\nversion",
"pyproject.toml:[tool.poetry]\nname = \"commitizen\"\nversion",
"commitizen/__version__.py"
] However that seems a little inelegant - also does not appear that syntax was used. I think changing it like this should work. version_files = ["pyproject.toml:^version"] Perhaps just the docs needs an update to say that regex is permitted? |
Yes, updating the docs should be enough, would you mind sending a pr or describing here where would you update? |
The docs already say that a regex is permitted. |
Maybe what we need is adding it to the FAQ page might be a good idea |
I suppose it might also help to clarify in the documentation I linked to above that the pattern is a Python regular expression matched using re.finditer. That would also serve the purpose of clarifying that the file isn't searched line by line. Or see #498 for a proposed alternative to the current matching behavior. |
Just to be clear on this: Is the current recommended action to use FWIW I was thinking that it would be great if we could specify a full TOML qualifier like |
Basically, you can use whatever Python regex suits your needs. Worst case, you could add a comment to one line and not the other(s) if they are identical. The regex is matched line by line these days, which makes it simpler to choose one appropriate to your situation in my opinion. |
Option 1When selecting version, start with
Option 2 (recommended)Use Sample: [tool.commitizen]
version_provider = "poetry" |
Should we add it as part of our FAQ? I think it's something worth mentioning |
Yes, could be a good idea, under which question would be add it? They are both documented, but not together |
I think we can just add a question to FAQ, paste your response and add come links to other parts of the document. |
Description
When a dep is specified using the
{}
syntax, egand the version of the dep matches the version of the project, then
bump
will change both versions.Is it possible to specify a regex in the configuration - ie to ensure that the
version
string is at the start of line, not in the middle?Ref https://commitizen-tools.github.io/commitizen/config/#pyprojecttoml-or-cztoml
Steps to reproduce
Create a project, where the project version is the same as a dependency version, and where the dependency uses poetry's optional
{}
syntaxInit
Check the current version of the project
Make a change
bump the project
See the version change in the dependency...
This line should not have changed:
smart-open = {version = ">=5.2.0,<6.2.0", extras = ["s3"]}
Current behavior
bump erroneously changes more than it should in the toml file
Desired behavior
bump only changes the right strings in the toml file
Screenshots
No response
Environment
cz version -> 2.23.0
The text was updated successfully, but these errors were encountered: