Skip to content
Myr

⬆ Bump ruff from 0.2.0 to 0.6.1 (#938)

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

* ⬆ Bump ruff from 0.2.0 to 0.6.1 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.0 to 0.6.1. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.2.0...0.6.1) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: svlandeg <svlandeg@github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

authored by dependabot[bot] · committed by GitHub · parent ae82de0 · Browse files · 6 files+18 added−27 removed
This commit

State

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

Diff stats

6 files+18 added−27 removed

  • tests:+5 added−10 removed
  • other:+13 added−17 removed

6 files+18 added−27 removed

modified:tests/test_ambiguous_params.py+5 added-10 removed
27 unmodified lines
2829 # This test case only works with `typer.Argument`. `typer.Option` uses positionals30 # for param_decls too.31 @app.command()32 def cmd(my_param: Annotated[str, typer.Argument("foo")]):33 ... # pragma: no cover32 def cmd(my_param: Annotated[str, typer.Argument("foo")]): ... # pragma: no cover3334 with pytest.raises(AnnotatedParamWithDefaultValueError) as excinfo:35 runner.invoke(app)36
25 unmodified lines
62def test_forbid_annotated_param_and_default_param(param, param_info_type):63 app = typer.Typer()6465 @app.command()67 def cmd(my_param: Annotated[str, param()] = param("foo")):68 ... # pragma: no cover66 def cmd(my_param: Annotated[str, param()] = param("foo")): ... # pragma: no cover6768 with pytest.raises(MixedAnnotatedAndDefaultStyleError) as excinfo:69 runner.invoke(app)70
9 unmodified lines
8081 @app.command()82 def cmd(83 my_param: Annotated[str, typer.Argument(), typer.Argument()],86 ):87 ... # pragma: no cover84 ): ... # pragma: no cover8586 with pytest.raises(MultipleTyperAnnotationsError) as excinfo:87 runner.invoke(app)88
28 unmodified lines
117118 @app.command()119 def cmd(120 my_param: Annotated[str, param(default_factory=make_string)] = "hello",124 ):125 ... # pragma: no cover121 ): ... # pragma: no cover122123 with pytest.raises(DefaultFactoryAndDefaultValueError) as excinfo:124 runner.invoke(app)125
40 unmodified lines
166167 @app.command()168 def cmd(169 my_param: str = param("hi", default_factory=make_string),174 ):175 ... # pragma: no cover170 ): ... # pragma: no cover171172 with pytest.raises(DefaultFactoryAndDefaultValueError) as excinfo:173 runner.invoke(app)174
57 unmodified lines
modified:typer/main.py+4 added-4 removed
713 unmodified lines
714715 elif parameter_info.parser is not None:716 return click.types.FuncParamType(parameter_info.parser)717718 elif annotation == str:718 elif annotation is str:719 return click.STRING720 elif annotation == int:720 elif annotation is int:721 if parameter_info.min is not None or parameter_info.max is not None:722 min_ = None723 max_ = None724 if parameter_info.min is not None:
2 unmodified lines
727 max_ = int(parameter_info.max)728 return click.IntRange(min=min_, max=max_, clamp=parameter_info.clamp)729 else:730 return click.INT731 elif annotation == float:731 elif annotation is float:732 if parameter_info.min is not None or parameter_info.max is not None:733 return click.FloatRange(734 min=parameter_info.min,735 max=parameter_info.max,736 clamp=parameter_info.clamp,737 )738 else:739 return click.FLOAT740 elif annotation == bool:740 elif annotation is bool:741 return click.BOOL742 elif annotation == UUID:743 return click.UUID744 elif annotation == datetime:
336 unmodified lines
modified:typer/params.py+4 added-8 removed
66 unmodified lines
67 allow_dash: bool = False,68 path_type: Union[None, Type[str], Type[bytes]] = None,69 # Rich settings70 rich_help_panel: Union[str, None] = None,71) -> Any:72 ...71) -> Any: ...727374# Overload for Option created with custom type 'click_type'75@overload
54 unmodified lines
130 allow_dash: bool = False,131 path_type: Union[None, Type[str], Type[bytes]] = None,132 # Rich settings133 rich_help_panel: Union[str, None] = None,135) -> Any:136 ...134) -> Any: ...135136137def Option(138 # Parameter
163 unmodified lines
302 allow_dash: bool = False,303 path_type: Union[None, Type[str], Type[bytes]] = None,304 # Rich settings305 rich_help_panel: Union[str, None] = None,308) -> Any:309 ...306) -> Any: ...307308309# Overload for Argument created with custom type 'click_type'310@overload
46 unmodified lines
357 allow_dash: bool = False,358 path_type: Union[None, Type[str], Type[bytes]] = None,359 # Rich settings360 rich_help_panel: Union[str, None] = None,364) -> Any:365 ...361) -> Any: ...362363364def Argument(365 # Parameter
99 unmodified lines
modified:typer/rich_utils.py+3 added-3 removed
66 unmodified lines
67STYLE_ERRORS_SUGGESTION = "dim"68STYLE_ABORTED = "red"69_TERMINAL_WIDTH = getenv("TERMINAL_WIDTH")70MAX_WIDTH = int(_TERMINAL_WIDTH) if _TERMINAL_WIDTH else None71COLOR_SYSTEM: Optional[72 Literal["auto", "standard", "256", "truecolor", "windows"]73] = "auto" # Set to None to disable colors71COLOR_SYSTEM: Optional[Literal["auto", "standard", "256", "truecolor", "windows"]] = (72 "auto" # Set to None to disable colors73)74_TYPER_FORCE_DISABLE_TERMINAL = getenv("_TYPER_FORCE_DISABLE_TERMINAL")75FORCE_TERMINAL = (76 True77 if getenv("GITHUB_ACTIONS") or getenv("FORCE_COLOR") or getenv("PY_COLORS")
634 unmodified lines
modified:.pre-commit-config.yaml+1 added-1 removed
modified:requirements-tests.txt+1 added-1 removed
4 unmodified lines
5coverage[toml] >=6.2,<8.06pytest-xdist >=1.32.0,<4.0.07pytest-sugar >=0.9.4,<1.1.08mypy ==1.4.19ruff ==0.2.09ruff ==0.6.110# Needed explicitly by typer-slim11rich >=10.11.012shellingham >=1.3.0