Skip to content

Commit 7cb1ea1

Browse files
authored
[click-web] Remove from pyrightconfig (#14312)
1 parent e27ad6d commit 7cb1ea1

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

pyrightconfig.stricter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"stubs/boltons",
3232
"stubs/braintree",
3333
"stubs/cffi",
34-
"stubs/click-web",
34+
"stubs/click-web/resources/input_fields.pyi",
3535
"stubs/dateparser",
3636
"stubs/defusedxml",
3737
"stubs/docker",
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
from typing import Any, TypedDict, type_check_only
2+
13
import click
24

5+
@type_check_only
6+
class _FormData(TypedDict):
7+
command: click.Command
8+
fields: list[dict[str, Any]] # each item is result of resources.input_fields.get_input_field() function
9+
310
def get_form_for(command_path: str) -> str: ...
411
def _get_commands_by_path(command_path: str) -> list[tuple[click.Context, click.Command]]: ...
5-
def _generate_form_data(ctx_and_commands: list[tuple[click.Context, click.Command]]): ...
12+
def _generate_form_data(ctx_and_commands: list[tuple[click.Context, click.Command]]) -> list[_FormData]: ...
613
def _process_help(help_text: bool) -> str: ...

stubs/click-web/click_web/resources/input_fields.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class FieldId:
2525
form_type: str,
2626
name: str,
2727
key: str | None = None,
28-
): ...
28+
) -> None: ...
2929
@classmethod
3030
def from_string(cls, field_info_as_string: str) -> FieldId: ...
3131

@@ -44,7 +44,7 @@ class BaseInput:
4444
@property
4545
def type_attrs(self) -> dict[str, Any]: ...
4646
def _to_cmd_line_name(self, name: str) -> str: ...
47-
def _build_name(self, name: str): ...
47+
def _build_name(self, name: str) -> str: ...
4848

4949
class ChoiceInput(BaseInput):
5050
if sys.version_info >= (3, 10):
@@ -82,4 +82,4 @@ class DefaultInput(BaseInput):
8282
INPUT_TYPES: Final[list[type[BaseInput]]]
8383
_DEFAULT_INPUT: Final[list[type[DefaultInput]]]
8484

85-
def get_input_field(ctx: click.Context, param: click.Parameter, command_index, param_index) -> dict[str, Any]: ...
85+
def get_input_field(ctx: click.Context, param: click.Parameter, command_index: int, param_index: int) -> dict[str, Any]: ...

0 commit comments

Comments
 (0)