diff --git a/.gitignore b/.gitignore index e5048315..8e8280a5 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,3 @@ docs/_build docs/spec docs/stories __pycache__ -/fmf/_version.py diff --git a/fmf/__init__.py b/fmf/__init__.py index 49ec2a6e..12af8b89 100644 --- a/fmf/__init__.py +++ b/fmf/__init__.py @@ -2,11 +2,14 @@ from __future__ import annotations -from fmf._version import __version__ # noqa: F401 +import importlib.metadata + from fmf.base import Tree from fmf.context import Context from fmf.utils import filter +__version__ = importlib.metadata.version("fmf") + __all__ = [ "Context", "Tree", diff --git a/pyproject.toml b/pyproject.toml index 890a02ff..46a88f2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,6 @@ fmf = 'fmf.cli:cli_entry' [tool.hatch] version.source = 'vcs' version.raw-options.version_scheme = 'post-release' -build.hooks.vcs.version-file = "fmf/_version.py" [tool.hatch.build.targets.wheel] packages = ['fmf']