From 9f69057b9be05cb367521459703bd4be958b6ae6 Mon Sep 17 00:00:00 2001 From: matejcik Date: Wed, 13 Jul 2022 15:02:25 +0200 Subject: [PATCH] fix(python): fix Click 7.x by passing explicit version to version_option --- python/src/trezorlib/cli/trezorctl.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/python/src/trezorlib/cli/trezorctl.py b/python/src/trezorlib/cli/trezorctl.py index 5dc673433..b39f66674 100755 --- a/python/src/trezorlib/cli/trezorctl.py +++ b/python/src/trezorlib/cli/trezorctl.py @@ -24,7 +24,7 @@ from typing import TYPE_CHECKING, Any, Callable, Iterable, Optional, TypeVar, ca import click -from .. import log, messages, protobuf, ui +from .. import __version__, log, messages, protobuf, ui from ..client import TrezorClient from ..transport import DeviceIsBusy, enumerate_devices from ..transport.udp import UdpTransport @@ -170,7 +170,7 @@ def configure_logging(verbose: int) -> None: help="Resume given session ID.", default=os.environ.get("TREZOR_SESSION_ID"), ) -@click.version_option(package_name="trezor") +@click.version_option(version=__version__) @click.pass_context def cli_main( ctx: click.Context, @@ -262,9 +262,7 @@ def list_devices(no_resolve: bool) -> Optional[Iterable["Transport"]]: @cli.command() def version() -> str: """Show version of trezorctl/trezorlib.""" - from .. import __version__ as VERSION - - return VERSION + return __version__ #