2

Hello I am building a pyproject object and I have the following two sections

[tool.poetry]
version = "0.1.0"

[tool.commitizen]
version = "0.1.0"

As you can see poetry uses the version in its section and commitizen in its section, the question is how to can I set only one version and share between sections?

Thanks

sinoroc
  • 18,409
  • 2
  • 39
  • 70
Tlaloc-ES
  • 4,825
  • 7
  • 38
  • 84

2 Answers2

2

You cannot. The TOML syntax doesn't support this. (https://github.com/toml-lang/toml/issues/829)

finswimmer
  • 10,896
  • 3
  • 34
  • 44
1

Finnaly I do with

[tool.poetry]
name = "aipose"
version = "1.0.0"

[tool.commitizen]
version = "1.0.0"
version_files = [
    "pyproject.toml:^version"
]
tag_format = "$version"

You can check a complete use with github actions in this repository: https://github.com/Tlaloc-Es/aipose/

Source:

Tlaloc-ES
  • 4,825
  • 7
  • 38
  • 84