-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read project metadata from pyproject.toml #59
Comments
More here, from an issue on the poetry repo: How to get version from pyproject.toml from python app? · Issue #273 · python-poetry/poetry |
@stratofax said:
It does generate the files but we do not need The example in the post below shows how we can mostly just use
|
In a Python 3.8 virtualenv for BallotLab where
Caveats:
|
I'm not sure we even need to use It looks like reading the version number is both possible and useful. Do you want to implement this in |
Single source of truth!
One possible solution: create an
__about__.py
file that usesimportlib.metadata
to get the version and package_name from the poetry-generated environment. Then updateconstants.py
to read the values from__about__.py
instead of updating them by hand. This way, we don't have to rewrite code that reads the values from constants.py but we can effectively read the values from pyproject.toml.The text was updated successfully, but these errors were encountered: