nedbat / scriv

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

Error when using typed version with version = "literal: [...]" #85

Closed marvin8 closed 1 year ago

marvin8 commented 1 year ago

Loving scriv... thanks a lot.

In my case scriv errors out with the following exception when issuing scriv collect:

scriv.exceptions.ScrivException: Couldn't find literal: 'literal: src/fedinesia/__init__.py: __version__'

The file exists and has a valid definition for the version variable. The one thing "special" in my case is that I have the variable typed. Below is an abbreviated version of my init.py file:

from typing import Final

__version__: Final[str] = "2.4.0"

If I remove the typing and write the version definition like __version__ = "2.4.0" collect works as expected.

Is it possible to make scriv work with typed variables to determine the version?

nedbat commented 1 year ago

Good catch! This is fixed in commit 801fb4e68b7e8b30fca45f6cccf51a2c3ddefd05.

nedbat commented 1 year ago

This is now released as part of scriv 1.2.1.

marvin8 commented 1 year ago

Thanks... just updated and works with my "fancy" setup now... awesome!