Skip to content

Commit 088cb1c

Browse files
committed
fix types
1 parent 0bc9ee0 commit 088cb1c

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

typer/core.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def get_help_record(self, ctx: click.Context) -> tuple[str, str] | None:
376376
help = f"{help} {extra_str}" if help else f"{extra_str}"
377377
return name, help
378378

379-
def make_metavar(self, ctx: click.Context | None = None) -> str:
379+
def make_metavar(self, ctx: click.Context) -> str:
380380
# Modified version of click.core.Argument.make_metavar()
381381
# to include Argument name
382382
if self.metavar is not None:
@@ -387,8 +387,7 @@ def make_metavar(self, ctx: click.Context | None = None) -> str:
387387
var = (self.name or "").upper()
388388
if not self.required:
389389
var = f"[{var}]"
390-
type_var = self.type.get_metavar(self, ctx=ctx) # type: ignore[arg-type]
391-
# type_var = self.type.get_metavar(self, ctx=ctx)
390+
type_var = self.type.get_metavar(self, ctx=ctx)
392391
if type_var:
393392
var += f":{type_var}"
394393
if self.nargs != 1:
@@ -487,8 +486,8 @@ def _extract_default_help_str(
487486
) -> Any | Callable[[], Any] | None:
488487
return _extract_default_help_str(self, ctx=ctx)
489488

490-
def make_metavar(self, ctx: click.Context | None = None) -> str:
491-
return super().make_metavar(ctx=ctx) # type: ignore[arg-type]
489+
def make_metavar(self, ctx: click.Context) -> str:
490+
return super().make_metavar(ctx=ctx)
492491

493492
def get_help_record(self, ctx: click.Context) -> tuple[str, str] | None:
494493
# Duplicate all of Click's logic only to modify a single line, to allow boolean

typer/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def except_hook(
7373
_original_except_hook(exc_type, exc_value, tb)
7474
return
7575
typer_path = os.path.dirname(__file__)
76-
click_path = os.path.dirname(click.__file__) # ty: ignore
76+
click_path = os.path.dirname(click.__file__)
7777
internal_dir_names = [typer_path, click_path]
7878
exc = exc_value
7979
if HAS_RICH:

0 commit comments

Comments
 (0)