Skip to content
Myr

👽️ Ensure compatibility with Click 8.3.0 by restoring the original `value_is_missing` function (#1333)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sofie Van Landeghem · committed by GitHub · parent 47e3bd6 · Browse files · 1 file+20 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

Diff stats

1 file+20 added−0 removed

  • other:+20 added−0 removed

1 file+20 added−0 removed

modified:typer/core.py+20 added
401 unmodified lines
402 if self.nargs != 1:403 var += "..."404 return var405406 def value_is_missing(self, value: Any) -> bool:407 return _value_is_missing(self, value)408409410class TyperOption(click.core.Option):411 def __init__(412 self,413 *,
181 unmodified lines
595 help = f"{help} {extra_str}" if help else f"{extra_str}"596597 return ("; " if any_prefix_is_slash else " / ").join(rv), help598599 def value_is_missing(self, value: Any) -> bool:600 return _value_is_missing(self, value)601602603def _value_is_missing(param: click.Parameter, value: Any) -> bool:604 if value is None:605 return True606607 # Click 8.3 and beyond608 # if value is UNSET:609 # return True610611 if (param.nargs != 1 or param.multiple) and value == ():612 return True # pragma: no cover613614 return False615616617def _typer_format_options(618 self: click.core.Command, *, ctx: click.Context, formatter: click.HelpFormatter619) -> None:620 args = []
191 unmodified lines