Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ github-actions = [
tests = [
"coverage[toml] >=7.13",
"mypy >=1.19.1",
"ty >=0.0.9",
"ty >=0.0.25",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping the lower bound, as 0.0.24 and 0.0.25 are quite different, cf. astral-sh/ruff#24096.

"pytest >=9.0.0",
"pytest-cov >=4.0.0",
"pytest-sugar >=0.9.5",
Expand Down
9 changes: 4 additions & 5 deletions typer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def get_help_record(self, ctx: click.Context) -> tuple[str, str] | None:
help = f"{help} {extra_str}" if help else f"{extra_str}"
return name, help

def make_metavar(self, ctx: click.Context | None = None) -> str:
def make_metavar(self, ctx: click.Context) -> str:
# Modified version of click.core.Argument.make_metavar()
# to include Argument name
if self.metavar is not None:
Expand All @@ -387,8 +387,7 @@ def make_metavar(self, ctx: click.Context | None = None) -> str:
var = (self.name or "").upper()
if not self.required:
var = f"[{var}]"
type_var = self.type.get_metavar(self, ctx=ctx) # type: ignore[arg-type]
# type_var = self.type.get_metavar(self, ctx=ctx)
type_var = self.type.get_metavar(self, ctx=ctx)
if type_var:
var += f":{type_var}"
if self.nargs != 1:
Expand Down Expand Up @@ -487,8 +486,8 @@ def _extract_default_help_str(
) -> Any | Callable[[], Any] | None:
return _extract_default_help_str(self, ctx=ctx)

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

def get_help_record(self, ctx: click.Context) -> tuple[str, str] | None:
# Duplicate all of Click's logic only to modify a single line, to allow boolean
Expand Down
2 changes: 1 addition & 1 deletion typer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def except_hook(
_original_except_hook(exc_type, exc_value, tb)
return
typer_path = os.path.dirname(__file__)
click_path = os.path.dirname(click.__file__) # ty: ignore
click_path = os.path.dirname(click.__file__)
internal_dir_names = [typer_path, click_path]
exc = exc_value
if HAS_RICH:
Expand Down
41 changes: 21 additions & 20 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading