🐛 Fix internal type annotations and bump mypy version (#638)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Paulo Costa · committed by GitHub · parent f83c66d · Browse files · 5 files·+9 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+9 added−9 removed
- other:+9 added−9 removed
Provenance
- Commit
3fe814e- Tree
eed14fa- Author
Paulo Costa <me@paulo.costa.nom.br>- Committer
GitHub <noreply@github.com>- Parent
f83c66d
5 files changed+9 added−9 removed
modified:typer/_typing.py+1 added-2 removed
2 unmodified lines3 # mypy: ignore-errors4 5 import sys6 from os import PathLike7-from typing import ( # type: ignore7+from typing import (8 TYPE_CHECKING,9 AbstractSet,10 Any,11 ClassVar,12 Dict,13 Generator,14- Iterable,14 List,15 Mapping,16 NewType,17 Optional,613 unmodified linesmodified:typer/completion.py+2 added-2 removed
1 import os2 import sys3-from typing import Any, Dict, Tuple3+from typing import Any, MutableMapping, Tuple4 5 import click6 7 from ._compat_utils import _get_click_major111 unmodified lines119 # And to add extra error messages, for compatibility with Typer in previous versions120 # This is only called in new Command method, only used by Click 8.x+121 def shell_complete(122 cli: click.BaseCommand,123- ctx_args: Dict[str, Any],123+ ctx_args: MutableMapping[str, Any],124 prog_name: str,125 complete_var: str,126 instruction: str,127 ) -> int:33 unmodified linesmodified:typer/core.py+4 added-3 removed
7 unmodified lines8 Any,9 Callable,10 Dict,11 List,12+ MutableMapping,13 Optional,14 Sequence,15 TextIO,16 Tuple,617 unmodified lines634 635 def _typer_main_shell_completion(636 self: click.core.Command,637 *,637- ctx_args: Dict[str, Any],638+ ctx_args: MutableMapping[str, Any],639 prog_name: str,640 complete_var: Optional[str] = None,641 ) -> None:642 if complete_var is None:53 unmodified lines696 _typer_format_options(self, ctx=ctx, formatter=formatter)697 698 def _main_shell_completion(699 self,699- ctx_args: Dict[str, Any],700+ ctx_args: MutableMapping[str, Any],701 prog_name: str,702 complete_var: Optional[str] = None,703 ) -> None:704 _typer_main_shell_completion(53 unmodified lines758 self.format_commands(ctx, formatter)759 760 def _main_shell_completion(761 self,761- ctx_args: Dict[str, Any],762+ ctx_args: MutableMapping[str, Any],763 prog_name: str,764 complete_var: Optional[str] = None,765 ) -> None:766 _typer_main_shell_completion(30 unmodified linesmodified:typer/main.py+1 added-1 removed
49 unmodified lines50 _typer_developer_exception_attr_name = "__typer_developer_exception__"51 52 53 def except_hook(54- exc_type: Type[BaseException], exc_value: BaseException, tb: TracebackType54+ exc_type: Type[BaseException], exc_value: BaseException, tb: Optional[TracebackType]55 ) -> None:56 exception_config: Union[DeveloperExceptionConfig, None] = getattr(57 exc_value, _typer_developer_exception_attr_name, None58 )998 unmodified linesmodified:pyproject.toml+1 added-1 removed
45 unmodified lines4647484950505152535442 unmodified lines45 unmodified lines "pytest-cov >=2.10.0,<5.0.0", "coverage >=6.2,<7.0", "pytest-xdist >=1.32.0,<4.0.0", "pytest-sugar >=0.9.4,<0.10.0", "mypy ==0.910", "mypy ==0.971", "black >=22.3.0,<23.0.0", "isort >=5.0.6,<6.0.0", "rich >=10.11.0,<14.0.0",]42 unmodified lines