Skip to content

Support version_files together with version_provider=poetry #1066

Closed
@jzazo

Description

@jzazo

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"]

Activity

noirbizarre

noirbizarre commented on Apr 17, 2024

@noirbizarre
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

jzazo commented on Apr 17, 2024

@jzazo
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @noirbizarre@jzazo

        Issue actions

          Support version_files together with version_provider=poetry · Issue #1066 · commitizen-tools/commitizen