nedbat / scriv

Changelog management tool

Home Page:https://scriv.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Read version info from `pyproject.toml`

kurtmckee opened this issue · comments

Hi Ned! I'm looking for a way to read the app version from the pyproject.toml file, which is used as the single source of metadata truth in several projects I've started working on.

I'd like to contribute support for this ASAP but I wanted to first ask what your thoughts are regarding this? It appears that you've already teed up additional use of literal: for this purpose...what syntax would you envision for this in the scriv configuration? Would something this be an option:

version = "literal: pyproject.toml: tool.poetry.version"

tool.poetry.version would get resolved to dictionary traversal of the loaded TOML file (like config["tool"]["poetry"]["version"]).

If this proposal sounds reasonable I'll cook up a PR with some tests and submit that for your review.

Thanks for your work on scriv, it's a great tool to work with!

Hi Kurt, thanks. Just for concreteness, can you link me to one of your projects that would use it this way?

Thanks for the quick response! I've started working at a company that has recently introduced scriv to several public repos. Here's the one where I encountered this scriv/TOML combo:

https://github.com/globus/globus-automate-client