Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
marvin8 opened this issue Feb 18, 2023 · 3 comments
Closed

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

marvin8 opened this issue Feb 18, 2023 · 3 comments

Comments

@marvin8
Copy link

marvin8 commented Feb 18, 2023

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
Copy link
Owner

nedbat commented Feb 19, 2023

Good catch! This is fixed in commit 801fb4e.

@nedbat nedbat closed this as completed Feb 19, 2023
@nedbat
Copy link
Owner

nedbat commented Feb 19, 2023

This is now released as part of scriv 1.2.1.

@marvin8
Copy link
Author

marvin8 commented Feb 19, 2023

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants