mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +00:00
fix(python): fix Click 7.x by passing explicit version to version_option
This commit is contained in:
parent
bd9bfc6996
commit
9f69057b9b
@ -24,7 +24,7 @@ from typing import TYPE_CHECKING, Any, Callable, Iterable, Optional, TypeVar, ca
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from .. import log, messages, protobuf, ui
|
from .. import __version__, log, messages, protobuf, ui
|
||||||
from ..client import TrezorClient
|
from ..client import TrezorClient
|
||||||
from ..transport import DeviceIsBusy, enumerate_devices
|
from ..transport import DeviceIsBusy, enumerate_devices
|
||||||
from ..transport.udp import UdpTransport
|
from ..transport.udp import UdpTransport
|
||||||
@ -170,7 +170,7 @@ def configure_logging(verbose: int) -> None:
|
|||||||
help="Resume given session ID.",
|
help="Resume given session ID.",
|
||||||
default=os.environ.get("TREZOR_SESSION_ID"),
|
default=os.environ.get("TREZOR_SESSION_ID"),
|
||||||
)
|
)
|
||||||
@click.version_option(package_name="trezor")
|
@click.version_option(version=__version__)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def cli_main(
|
def cli_main(
|
||||||
ctx: click.Context,
|
ctx: click.Context,
|
||||||
@ -262,9 +262,7 @@ def list_devices(no_resolve: bool) -> Optional[Iterable["Transport"]]:
|
|||||||
@cli.command()
|
@cli.command()
|
||||||
def version() -> str:
|
def version() -> str:
|
||||||
"""Show version of trezorctl/trezorlib."""
|
"""Show version of trezorctl/trezorlib."""
|
||||||
from .. import __version__ as VERSION
|
return __version__
|
||||||
|
|
||||||
return VERSION
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user