From 4d0f924c9c0fa7f2632e65bc1ad77828eaa17629 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Oct 2025 19:31:58 +0000 Subject: [PATCH 1/4] build(deps): bump click from 8.1.8 to 8.3.0 Bumps [click](https://github.com/pallets/click) from 8.1.8 to 8.3.0. - [Release notes](https://github.com/pallets/click/releases) - [Changelog](https://github.com/pallets/click/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/click/compare/8.1.8...8.3.0) --- updated-dependencies: - dependency-name: click dependency-version: 8.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index 663af759b2f8..238d93b64dc3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1018,14 +1018,14 @@ files = [ [[package]] name = "click" -version = "8.1.8" +version = "8.3.0" description = "Composable command line interface toolkit" optional = false -python-versions = ">=3.7" +python-versions = ">=3.10" groups = ["main"] files = [ - {file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"}, - {file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"}, + {file = "click-8.3.0-py3-none-any.whl", hash = "sha256:9b9f285302c6e3064f4330c05f05b81945b2a39544279343e6e7c5f27a9baddc"}, + {file = "click-8.3.0.tar.gz", hash = "sha256:e7b8232224eba16f4ebe410c25ced9f7875cb5f3263ffc93cc3e8da705e229c4"}, ] [package.dependencies] From 41799733401ab2557208861e74026ca6df2ab7ec Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Wed, 15 Oct 2025 15:05:52 -0700 Subject: [PATCH 2/4] Remove workaround for click.Choice and Enum --- benchmarks/streamable.py | 6 +++--- benchmarks/utils.py | 18 +----------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/benchmarks/streamable.py b/benchmarks/streamable.py index d7d8a4a8f02b..a6018b8d4fdf 100644 --- a/benchmarks/streamable.py +++ b/benchmarks/streamable.py @@ -14,7 +14,7 @@ from chia_rs.sized_bytes import bytes32 from chia_rs.sized_ints import uint8, uint64 -from benchmarks.utils import EnumType, get_commit_hash +from benchmarks.utils import get_commit_hash from chia._tests.util.benchmarks import rand_full_block, rand_hash from chia.util.streamable import Streamable, streamable @@ -226,8 +226,8 @@ def compare_results( @click.command() -@click.option("-d", "--data", default=Data.all, type=EnumType(Data)) -@click.option("-m", "--mode", default=Mode.all, type=EnumType(Mode)) +@click.option("-d", "--data", default=Data.all, type=click.Choice(Data)) +@click.option("-m", "--mode", default=Mode.all, type=click.Choice(Mode)) @click.option("-r", "--runs", default=100, help="Number of benchmark runs to average results") @click.option("-t", "--ms", default=50, help="Milliseconds per run") @click.option("--live/--no-live", default=False, help="Print live results (slower)") diff --git a/benchmarks/utils.py b/benchmarks/utils.py index 97b1b2066083..1f8c756d22f5 100644 --- a/benchmarks/utils.py +++ b/benchmarks/utils.py @@ -1,31 +1,15 @@ from __future__ import annotations import contextlib -import enum import os import subprocess import sys from collections.abc import AsyncIterator from pathlib import Path -from typing import Any, Generic, Optional, TypeVar, Union - -import click +from typing import Optional, Union from chia.util.db_wrapper import DBWrapper2 -_T_Enum = TypeVar("_T_Enum", bound=enum.Enum) - - -# Workaround to allow `Enum` with click.Choice: https://github.com/pallets/click/issues/605#issuecomment-901099036 -class EnumType(click.Choice, Generic[_T_Enum]): - def __init__(self, enum: type[_T_Enum], case_sensitive: bool = False) -> None: - self.__enum = enum - super().__init__(choices=[item.value for item in enum], case_sensitive=case_sensitive) - - def convert(self, value: Any, param: Optional[click.Parameter], ctx: Optional[click.Context]) -> _T_Enum: - converted_str = super().convert(value, param, ctx) - return self.__enum(converted_str) - @contextlib.asynccontextmanager async def setup_db(name: Union[str, os.PathLike[str]], db_version: int) -> AsyncIterator[DBWrapper2]: From 798aff954b69ad2e7f3b0eb76a02b497d9c9f495 Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Thu, 16 Oct 2025 11:38:03 -0700 Subject: [PATCH 3/4] place the default sortkey first to fix some click strangeness --- chia/cmds/wallet.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/chia/cmds/wallet.py b/chia/cmds/wallet.py index c91158d84922..5a5fd402e439 100644 --- a/chia/cmds/wallet.py +++ b/chia/cmds/wallet.py @@ -94,7 +94,7 @@ def get_transaction_cmd( "--limit", help="Max number of transactions to return", type=int, - default=(2**32 - 1), + default=(2**16 - 1), show_default=True, required=False, ) @@ -105,19 +105,19 @@ def get_transaction_cmd( help="Prompt for each page of data. Defaults to true for interactive consoles, otherwise false.", ) @click.option( - "--sort-by-height", + "--sort-by-relevance", "sort_key", - flag_value=SortKey.CONFIRMED_AT_HEIGHT, + flag_value=SortKey.RELEVANCE, type=SortKey, - help="Sort transactions by height", + default=SortKey.RELEVANCE, + help="Sort transactions by {confirmed, height, time}", ) @click.option( - "--sort-by-relevance", + "--sort-by-height", "sort_key", - flag_value=SortKey.RELEVANCE, + flag_value=SortKey.CONFIRMED_AT_HEIGHT, type=SortKey, - default=True, - help="Sort transactions by {confirmed, height, time}", + help="Sort transactions by height", ) @click.option( "--reverse", From 41eb6ddf0deaebf1b63d7096e69d32b8ca4a402f Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Thu, 16 Oct 2025 12:20:20 -0700 Subject: [PATCH 4/4] Ignore duplicate option warnings for specific test --- chia/_tests/wallet/test_signer_protocol.py | 1 + 1 file changed, 1 insertion(+) diff --git a/chia/_tests/wallet/test_signer_protocol.py b/chia/_tests/wallet/test_signer_protocol.py index c1d7a0dc590e..5817478613bc 100644 --- a/chia/_tests/wallet/test_signer_protocol.py +++ b/chia/_tests/wallet/test_signer_protocol.py @@ -687,6 +687,7 @@ async def test_signer_commands(wallet_environments: WalletTestFramework) -> None ) +@pytest.mark.filterwarnings("ignore:The parameter .* is used more than once:UserWarning") def test_signer_command_default_parsing() -> None: check_click_parsing( GatherSigningInfoCMD(