Skip to content

Commit 38d8598

Browse files
build(deps): bump click from 8.1.8 to 8.3.0 (#20146)
* 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](pallets/click@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] <[email protected]> * Remove workaround for click.Choice and Enum * place the default sortkey first to fix some click strangeness * Ignore duplicate option warnings for specific test --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Earle Lowe <[email protected]>
1 parent a332bef commit 38d8598

File tree

5 files changed

+17
-32
lines changed

5 files changed

+17
-32
lines changed

benchmarks/streamable.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from chia_rs.sized_bytes import bytes32
1515
from chia_rs.sized_ints import uint8, uint64
1616

17-
from benchmarks.utils import EnumType, get_commit_hash
17+
from benchmarks.utils import get_commit_hash
1818
from chia._tests.util.benchmarks import rand_full_block, rand_hash
1919
from chia.util.streamable import Streamable, streamable
2020

@@ -226,8 +226,8 @@ def compare_results(
226226

227227

228228
@click.command()
229-
@click.option("-d", "--data", default=Data.all, type=EnumType(Data))
230-
@click.option("-m", "--mode", default=Mode.all, type=EnumType(Mode))
229+
@click.option("-d", "--data", default=Data.all, type=click.Choice(Data))
230+
@click.option("-m", "--mode", default=Mode.all, type=click.Choice(Mode))
231231
@click.option("-r", "--runs", default=100, help="Number of benchmark runs to average results")
232232
@click.option("-t", "--ms", default=50, help="Milliseconds per run")
233233
@click.option("--live/--no-live", default=False, help="Print live results (slower)")

benchmarks/utils.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,15 @@
11
from __future__ import annotations
22

33
import contextlib
4-
import enum
54
import os
65
import subprocess
76
import sys
87
from collections.abc import AsyncIterator
98
from pathlib import Path
10-
from typing import Any, Generic, Optional, TypeVar, Union
11-
12-
import click
9+
from typing import Optional, Union
1310

1411
from chia.util.db_wrapper import DBWrapper2
1512

16-
_T_Enum = TypeVar("_T_Enum", bound=enum.Enum)
17-
18-
19-
# Workaround to allow `Enum` with click.Choice: https://github.com/pallets/click/issues/605#issuecomment-901099036
20-
class EnumType(click.Choice, Generic[_T_Enum]):
21-
def __init__(self, enum: type[_T_Enum], case_sensitive: bool = False) -> None:
22-
self.__enum = enum
23-
super().__init__(choices=[item.value for item in enum], case_sensitive=case_sensitive)
24-
25-
def convert(self, value: Any, param: Optional[click.Parameter], ctx: Optional[click.Context]) -> _T_Enum:
26-
converted_str = super().convert(value, param, ctx)
27-
return self.__enum(converted_str)
28-
2913

3014
@contextlib.asynccontextmanager
3115
async def setup_db(name: Union[str, os.PathLike[str]], db_version: int) -> AsyncIterator[DBWrapper2]:

chia/_tests/wallet/test_signer_protocol.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ async def test_signer_commands(wallet_environments: WalletTestFramework) -> None
687687
)
688688

689689

690+
@pytest.mark.filterwarnings("ignore:The parameter .* is used more than once:UserWarning")
690691
def test_signer_command_default_parsing() -> None:
691692
check_click_parsing(
692693
GatherSigningInfoCMD(

chia/cmds/wallet.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def get_transaction_cmd(
9494
"--limit",
9595
help="Max number of transactions to return",
9696
type=int,
97-
default=(2**32 - 1),
97+
default=(2**16 - 1),
9898
show_default=True,
9999
required=False,
100100
)
@@ -105,19 +105,19 @@ def get_transaction_cmd(
105105
help="Prompt for each page of data. Defaults to true for interactive consoles, otherwise false.",
106106
)
107107
@click.option(
108-
"--sort-by-height",
108+
"--sort-by-relevance",
109109
"sort_key",
110-
flag_value=SortKey.CONFIRMED_AT_HEIGHT,
110+
flag_value=SortKey.RELEVANCE,
111111
type=SortKey,
112-
help="Sort transactions by height",
112+
default=SortKey.RELEVANCE,
113+
help="Sort transactions by {confirmed, height, time}",
113114
)
114115
@click.option(
115-
"--sort-by-relevance",
116+
"--sort-by-height",
116117
"sort_key",
117-
flag_value=SortKey.RELEVANCE,
118+
flag_value=SortKey.CONFIRMED_AT_HEIGHT,
118119
type=SortKey,
119-
default=True,
120-
help="Sort transactions by {confirmed, height, time}",
120+
help="Sort transactions by height",
121121
)
122122
@click.option(
123123
"--reverse",

poetry.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,14 +1069,14 @@ files = [
10691069

10701070
[[package]]
10711071
name = "click"
1072-
version = "8.1.8"
1072+
version = "8.3.0"
10731073
description = "Composable command line interface toolkit"
10741074
optional = false
1075-
python-versions = ">=3.7"
1075+
python-versions = ">=3.10"
10761076
groups = ["main"]
10771077
files = [
1078-
{file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"},
1079-
{file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"},
1078+
{file = "click-8.3.0-py3-none-any.whl", hash = "sha256:9b9f285302c6e3064f4330c05f05b81945b2a39544279343e6e7c5f27a9baddc"},
1079+
{file = "click-8.3.0.tar.gz", hash = "sha256:e7b8232224eba16f4ebe410c25ced9f7875cb5f3263ffc93cc3e8da705e229c4"},
10801080
]
10811081

10821082
[package.dependencies]

0 commit comments

Comments
 (0)