Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rominf/poetry-version

Python library for extracting version from poetry pyproject.toml file
https://github.com/rominf/poetry-version

Last synced: about 2 months ago
JSON representation

Python library for extracting version from poetry pyproject.toml file

Awesome Lists containing this project

README

        

# poetry-version (deprecated)

## What to use instead

Now there is a better way to extract the version of the package.

Assuming your package is named `mypackage`:
```python
import importlib.metadata

__version__ = importlib.metadata.version("mypackage")
```

This code should work as is if you are using Python >= 3.8.

For Python 3.6 and 3.7 you need to install a backport: https://pypi.org/project/importlib-metadata/