From ad84e4be854272f1674d5ce871a2eaa9f36a02f8 Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Mon, 26 Jan 2026 15:52:48 +0900 Subject: [PATCH 1/3] Remove redundant origin help message from subcommand --- pyodide_cli/app.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pyodide_cli/app.py b/pyodide_cli/app.py index 21ae2c7..98f56f4 100644 --- a/pyodide_cli/app.py +++ b/pyodide_cli/app.py @@ -147,10 +147,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 +154,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 +163,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) From beb6598354035123a7f105c927c846df4b2277bd Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Mon, 26 Jan 2026 15:56:10 +0900 Subject: [PATCH 2/3] fix test --- pyodide_cli/app.py | 2 -- pyodide_cli/tests/test_cli.py | 9 --------- 2 files changed, 11 deletions(-) diff --git a/pyodide_cli/app.py b/pyodide_cli/app.py index 98f56f4..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__ diff --git a/pyodide_cli/tests/test_cli.py b/pyodide_cli/tests/test_cli.py index 29c9bd6..4c7475e 100644 --- a/pyodide_cli/tests/test_cli.py +++ b/pyodide_cli/tests/test_cli.py @@ -71,12 +71,3 @@ def test_plugin_origin(plugins): 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 From 2acccb01bada992817c25efca75b8424fc04d5c1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 06:56:45 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyodide_cli/tests/test_cli.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pyodide_cli/tests/test_cli.py b/pyodide_cli/tests/test_cli.py index 4c7475e..6fa2c15 100644 --- a/pyodide_cli/tests/test_cli.py +++ b/pyodide_cli/tests/test_cli.py @@ -70,4 +70,3 @@ def test_plugin_origin(plugins): msg = "Registered by plugin-test:" assert msg in output -