pythonpython-poetrypyproject.tomlcommitizen

How can I reference var from section into another section in pyproject.toml?


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


Solution

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