-
Notifications
You must be signed in to change notification settings - Fork 9
Replace Typer app with click cli #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
78d00c8
fa21139
374a4aa
1299c92
1a5a0eb
5a4ec40
cff02d3
ffbd85e
2190053
4777c04
9f76ca0
7ed7be9
fad12a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import click # type: ignore[import] | ||
|
|
||
|
|
||
| @click.group(invoke_without_command=True) | ||
| @click.pass_context | ||
| def cli(ctx: click.Context) -> None: | ||
| """ | ||
| Test help message short desc | ||
|
|
||
| Test help message long desc | ||
| """ | ||
| pass | ||
| if ctx.invoked_subcommand is None: | ||
| click.echo(ctx.get_help()) | ||
|
|
||
|
|
||
| @cli.command() | ||
| @click.argument("name", required=True) | ||
| def hello(name: str) -> None: | ||
| """ | ||
| Test help message short desc | ||
|
|
||
| Test help message long desc | ||
| """ | ||
| click.echo(f"Hello {name}") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,14 +67,16 @@ def func(q: Queue, with_sphinx=False): | |
|
|
||
| def test_plugin_origin(plugins): | ||
| output = check_output(["pyodide", "--help"]).decode("utf-8") | ||
| msg = "Registered by: plugin-test" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this message changed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The command section message is currently displayed as
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I think this one is better. Thanks. Could you also update here too for consistency?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The referenced message is appended to the long help message of each subcommands, which is slightly different from what
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think it is good to be consistent. |
||
| msg = "Registered by plugin-test:" | ||
|
|
||
| assert msg in output | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("entrypoint", ["plugin_test_app", "plugin_test_func"]) | ||
| @pytest.mark.parametrize( | ||
| "entrypoint", ["plugin_test_app", "plugin_test_func", "plugin_test_cli"] | ||
| ) | ||
| def test_plugin_origin_subcommand(plugins, entrypoint): | ||
| output = check_output(["pyodide", entrypoint, "--help"]).decode("utf-8") | ||
| msg = "Registered by: plugin-test" | ||
| msg = "Registered by plugin-test:" | ||
|
|
||
| assert msg in output | ||
Uh oh!
There was an error while loading. Please reload this page.