diff --git a/pyodide_cli/app.py b/pyodide_cli/app.py index 21ae2c7..b8a7a97 100644 --- a/pyodide_cli/app.py +++ b/pyodide_cli/app.py @@ -8,8 +8,6 @@ import click import typer -from typer.main import solve_typer_info_help -from typer.models import TyperInfo from . import __version__ @@ -147,10 +145,6 @@ def _entrypoint_to_version(entrypoint: EntryPoint) -> str: return dist.metadata["version"] -def _inject_origin(docstring: str, origin: str) -> str: - return f"{docstring}\n\n{origin}" - - def register_plugins(): """Register subcommands via the ``pyodide.cli`` entry-point""" eps = entry_points(group="pyodide.cli") @@ -158,18 +152,6 @@ def register_plugins(): for plugin_name, (module, ep) in plugins.items(): pkgname = _entrypoint_to_pkgname(ep) - origin_text = f"Registered by {pkgname}:" - - if isinstance(module, typer.Typer): - typer_info = TyperInfo(module) - help_with_origin = _inject_origin( - solve_typer_info_help(typer_info), origin_text - ) - else: - help_with_origin = _inject_origin( - getattr(module, "__doc__", ""), origin_text - ) - if isinstance(module, click.Command): cmd = module elif isinstance(module, typer.Typer): @@ -179,16 +161,12 @@ def register_plugins(): app = typer.Typer() app.command( plugin_name, - help=help_with_origin, **typer_kwargs, )(module) cmd = typer.main.get_command(app) else: raise RuntimeError(f"Invalid plugin: {plugin_name}") - # directly manipulate click Command help message - cmd.help = help_with_origin - cli.add_command(cmd, name=plugin_name, origin=pkgname) diff --git a/pyodide_cli/tests/test_cli.py b/pyodide_cli/tests/test_cli.py index 29c9bd6..6fa2c15 100644 --- a/pyodide_cli/tests/test_cli.py +++ b/pyodide_cli/tests/test_cli.py @@ -70,13 +70,3 @@ def test_plugin_origin(plugins): msg = "Registered by plugin-test:" assert msg in output - - -@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:" - - assert msg in output