Add __version__ attribute to package

This commit is contained in:
Vasili Syrakis
2021-03-31 11:31:47 +11:00
committed by Basileus
parent 342e6559dc
commit 7a358a63cf
5 changed files with 301 additions and 279 deletions

13
tests/test_version.py Normal file
View File

@@ -0,0 +1,13 @@
from betterproto import __version__
from pathlib import Path
import toml
PROJECT_TOML = Path(__file__).joinpath("..", "..", "pyproject.toml").resolve()
def test_version():
with PROJECT_TOML.open() as toml_file:
project_config = toml.load(toml_file)
assert (
__version__ == project_config["tool"]["poetry"]["version"]
), "Project version should match in package and package config"