Skip to content

Commit

Permalink
[pre-commit.ci] Apply automatic pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 3, 2025
1 parent 791ac06 commit be0351d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
12 changes: 9 additions & 3 deletions src/_nebari/subcommands/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
from _nebari.version import __version__
from nebari.hookspecs import hookimpl


@hookimpl
def nebari_subcommand(cli: typer.Typer):
EXTERNAL_PLUGIN_STYLE = "cyan"

@cli.command()
def info(ctx: typer.Context):
from nebari.plugins import nebari_plugin_manager
Expand Down Expand Up @@ -40,9 +41,14 @@ def info(ctx: typer.Context):
table.add_column("priority")
table.add_column("module")
for stage in nebari_plugin_manager.ordered_stages:
style = EXTERNAL_PLUGIN_STYLE if stage.__module__ in external_plugins else None
style = (
EXTERNAL_PLUGIN_STYLE if stage.__module__ in external_plugins else None
)
table.add_row(
stage.name, str(stage.priority), f"{stage.__module__}.{stage.__name__}", style=style
stage.name,
str(stage.priority),
f"{stage.__module__}.{stage.__name__}",
style=style,
)

rich.print(table)
14 changes: 7 additions & 7 deletions src/_nebari/subcommands/plugin.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from importlib.metadata import version

import rich
import typer
from rich.table import Table

from importlib.metadata import version

from _nebari.version import __version__
from nebari.hookspecs import hookimpl


@hookimpl
def nebari_subcommand(cli: typer.Typer):
plugin_cmd = typer.Typer(
Expand All @@ -19,16 +19,16 @@ def list(ctx: typer.Context):
List installed plugins
"""
from nebari.plugins import nebari_plugin_manager

external_plugins = nebari_plugin_manager.get_external_plugins()

table = Table(title="Plugins")
table.add_column("name", justify="left", no_wrap=True)
table.add_column("version", justify="left", no_wrap=True)

for plugin in external_plugins:
table.add_row(plugin, version(plugin))

rich.print(table)

cli.add_typer(plugin_cmd, name="plugin", rich_help_panel="Additional Commands")
cli.add_typer(plugin_cmd, name="plugin", rich_help_panel="Additional Commands")

0 comments on commit be0351d

Please sign in to comment.