Skip to content

Support version_files together with version_provider=poetry #1066

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
jzazo opened this issue Apr 15, 2024 · 2 comments
Closed

Support version_files together with version_provider=poetry #1066

jzazo opened this issue Apr 15, 2024 · 2 comments

Comments

@jzazo
Copy link

jzazo commented Apr 15, 2024

Description

I have a monorepo with multiple poetry projects. I would like configure version_provider=poetry and version_files in .cz.toml in the root. When I run cz bump all pyproject.toml files should be updated.

Possible Solution

[tool.commitizen]
tag_format = "v$version"
version_scheme = "pep440"
version_provider = "poetry"
version_files = [ "paths/to/pyproject.tomls"]

Additional context

I figured that following works, so maybe this request could be closed:

[tool.commitizen]
tag_format = "v$version"
version = "0.1.0"
version_scheme = "pep440"
version_files = [ "paths/to/pyproject.toml:version"]
@noirbizarre
Copy link
Member

#1070 should even allow this;

[tool.commitizen]
tag_format = "v$version"
version = "0.1.0"
version_scheme = "pep440"
version_files = [ "**/pyproject.toml"]

If you use git and are tagging versions, you can also rely on version_provider = "scm" and remove the hard-coded version (but you might need to check for proper scm versioning support in poetry)

(If this is working for you, don't forget to close the issue, please 🙏🏼)

@jzazo
Copy link
Author

jzazo commented Apr 17, 2024

Yes, using version_provider = "scm" allowed me to remove the bare version in the config. It seems to be working in a quick test, I still need to test it for dev versions (still need to figure that out). Thank you!

@jzazo jzazo closed this as completed Apr 17, 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