From e890fda8ff2c8f3c7a15980eed900af175bf5bf6 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 18 Mar 2024 15:43:39 +0100 Subject: [PATCH 1/4] fix capitalization --- docs/tutorial/arguments/optional.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/arguments/optional.md b/docs/tutorial/arguments/optional.md index c52e689a38..6bda570843 100644 --- a/docs/tutorial/arguments/optional.md +++ b/docs/tutorial/arguments/optional.md @@ -49,7 +49,7 @@ Now let's see an alternative way to create the same *CLI argument*: If you have an older version, you would get errors when trying to use `Annotated`. - Make sure you Upgrade the Typer version to at least 0.9.0 before using `Annotated`. + Make sure you upgrade the Typer version to at least 0.9.0 before using `Annotated`. Before, you had this function parameter: From 5edefae2dc4275f9d65c45e7767a0feca1b6cd9f Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 18 Mar 2024 17:47:34 +0100 Subject: [PATCH 2/4] fix space --- docs/help-typer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/help-typer.md b/docs/help-typer.md index 98cf4069e9..221492db38 100644 --- a/docs/help-typer.md +++ b/docs/help-typer.md @@ -234,7 +234,7 @@ As you have seen in the documentation, Typer is built on top of Click. You can also sponsor: -* Pallets Project (Click maintainers)via the PSF or via Tidelift +* Pallets Project (Click maintainers) via the PSF or via Tidelift --- From c4a89e917aca8907b64184bd97f13c9c8e34d085 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Tue, 26 Mar 2024 16:03:18 +0100 Subject: [PATCH 3/4] fix in unit test function name --- tests/test_others.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_others.py b/tests/test_others.py index 2c257518ca..9eb11136a9 100644 --- a/tests/test_others.py +++ b/tests/test_others.py @@ -29,7 +29,7 @@ def test_defaults_from_info(): assert value -def test_too_may_parsers(): +def test_too_many_parsers(): def custom_parser(value: str) -> int: return int(value) # pragma: no cover From 31247d25e0fe063a2347393155594db5e619860c Mon Sep 17 00:00:00 2001 From: svlandeg Date: Tue, 26 Mar 2024 16:04:02 +0100 Subject: [PATCH 4/4] update tutorial to have the same default as _an version --- docs_src/parameter_types/custom_types/tutorial001.py | 2 +- .../test_parameter_types/test_custom_types/test_tutorial001.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs_src/parameter_types/custom_types/tutorial001.py b/docs_src/parameter_types/custom_types/tutorial001.py index 456c46b52f..1ccf24cdfe 100644 --- a/docs_src/parameter_types/custom_types/tutorial001.py +++ b/docs_src/parameter_types/custom_types/tutorial001.py @@ -15,7 +15,7 @@ def parse_custom_class(value: str): def main( custom_arg: CustomClass = typer.Argument(parser=parse_custom_class), - custom_opt: CustomClass = typer.Option("Y", parser=parse_custom_class), + custom_opt: CustomClass = typer.Option("Foo", parser=parse_custom_class), ): print(f"custom_arg is {custom_arg}") print(f"--custom-opt is {custom_opt}") diff --git a/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial001.py b/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial001.py index e6a8be69ed..9a5dd790c7 100644 --- a/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial001.py +++ b/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial001.py @@ -26,7 +26,7 @@ def test_parse_custom_type(): def test_parse_custom_type_with_default(): result = runner.invoke(app, ["0"]) assert "custom_arg is " in result.output - assert "custom-opt is " in result.output + assert "custom-opt is " in result.output def test_script():