Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit 3c710fc

Browse files
author
staticdev
committed
Single source version
1 parent e0450d5 commit 3c710fc

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ homepage = "https://github.com/staticdev/toml-validator"
1212
python = "^3.7"
1313
tomlkit = "^0.5.9"
1414
click = "^7.0"
15+
importlib_metadata = {version = "^1.6.0", python = "<3.8"}
1516

1617
[tool.poetry.dev-dependencies]
1718
pytest = "^5.3.5"

src/toml_validator/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
__version__ = "0.1.0"
1+
"""The TOML validator."""
2+
try:
3+
from importlib.metadata import version, PackageNotFoundError # type: ignore
4+
except ImportError: # pragma: no cover
5+
from importlib_metadata import version, PackageNotFoundError # type: ignore
6+
7+
8+
try:
9+
__version__ = version(__name__)
10+
except PackageNotFoundError: # pragma: no cover
11+
__version__ = "unknown"

0 commit comments

Comments
 (0)