diff --git a/ethstaker_deposit/__init__.py b/ethstaker_deposit/__init__.py index e69de29b..3dd4e1c8 100644 --- a/ethstaker_deposit/__init__.py +++ b/ethstaker_deposit/__init__.py @@ -0,0 +1 @@ +__version__ = '0.1.3.dev' diff --git a/ethstaker_deposit/deposit.py b/ethstaker_deposit/deposit.py index 3bd37082..94c35f6e 100644 --- a/ethstaker_deposit/deposit.py +++ b/ethstaker_deposit/deposit.py @@ -23,6 +23,9 @@ fuzzy_reverse_dict_lookup, load_text, ) +from ethstaker_deposit.settings import ( + DEPOSIT_CLI_VERSION, +) def check_python_version() -> None: @@ -100,6 +103,7 @@ def list_commands(self, ctx: click.Context) -> list[str]: ), hidden=False, ) +@click.version_option(version=DEPOSIT_CLI_VERSION) def cli(ctx: click.Context, language: str, non_interactive: bool, ignore_connectivity: bool) -> None: if not ignore_connectivity and not non_interactive: check_connectivity() diff --git a/ethstaker_deposit/settings.py b/ethstaker_deposit/settings.py index 71f5ebb8..2503ac4b 100644 --- a/ethstaker_deposit/settings.py +++ b/ethstaker_deposit/settings.py @@ -1,7 +1,9 @@ from typing import Dict, NamedTuple, Optional from eth_utils import decode_hex -DEPOSIT_CLI_VERSION = '2.7.0' +from ethstaker_deposit import __version__ + +DEPOSIT_CLI_VERSION = __version__ class BaseChainSetting(NamedTuple): diff --git a/pyproject.toml b/pyproject.toml index 944f63ce..ddd6dd72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,13 +5,15 @@ build-backend = "setuptools.build_meta" [tool.setuptools] packages = ["ethstaker_deposit"] +[tool.setuptools.dynamic] +version = {attr = "ethstaker_deposit.__version__"} + [tool.pip-tools] generate-hashes = true no-annotate = true [project] name = "ethstaker_deposit" -version = "0.1.3" description = "Secure key generation for deposits" readme = "README.md" dependencies = [ @@ -23,6 +25,7 @@ dependencies = [ "ssz" ] requires-python = ">=3.9,<4" +dynamic = ["version"] [project.optional-dependencies] test = [