nedbat / scriv

Changelog management tool
https://scriv.readthedocs.io
Apache License 2.0
256 stars 28 forks source link

How to set [tool.scriv] version in pyproject.toml #68

Closed EliaOnceAgain closed 1 year ago

EliaOnceAgain commented 1 year ago

Given the following pyproject.toml:

[tool.poetry]
version = "0.1.3"

[tool.poetry.dependencies]
python = "^3.10"

[tool.poetry.group.dev.dependencies]
scriv = {extras = ["toml"], version = "^0.17.0"}

[tool.scriv]
format = "md"
version = literal: pyproject.toml: tool.poetry.version
# version = literal: myproj/__init__.py: __version__

Then running poetry shell results in:

Invalid TOML file ~/myproj/pyproject.toml: Unexpected character: 'l'

This also fails if I first activate my poetry venv using poetry shell then modify pyproject.toml and run scriv collect:

tomli.TOMLDecodeError: Invalid value
nedbat commented 1 year ago

Does it work to use this?

[tool.scriv]
format = "md"
version = "literal: pyproject.toml: tool.poetry.version"
EliaOnceAgain commented 1 year ago

It does actually! I might be having one of those days.. cheers for the quick reply ps: might be worth it updating the docs