Skip to content

Commit 634f5cc

Browse files
committed
Link plugins to public PyPI
1 parent 02dbbd3 commit 634f5cc

File tree

4 files changed

+34
-20
lines changed

4 files changed

+34
-20
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
## [0.0.5] - 2025-04-10
11+
12+
### Fixed
13+
14+
- Links to plugins on public PyPI
15+
1016
## [0.0.4] - 2025-04-10
1117

1218
### Added

src/minimal_pba_cli/plugin.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import importlib.metadata
22
import os
3-
import subprocess
43
from pathlib import Path
54
from typing import Annotated
65
from importlib.metadata import PackageNotFoundError, version
@@ -12,6 +11,8 @@
1211
from rich.console import Console
1312
from rich.table import Table
1413

14+
from minimal_pba_cli.util import run_external_subprocess
15+
1516

1617
plugin = typer.Typer()
1718

@@ -156,23 +157,6 @@ def find_plugins() -> dict[str, dict[str, str]]:
156157
return plugins
157158

158159

159-
def run_external_subprocess(args: list[str]) -> subprocess.CompletedProcess:
160-
"""Run an external subprocess and return the result."""
161-
162-
result = subprocess.run(args, capture_output=True, encoding="utf-8")
163-
164-
if result.stdout:
165-
typer.echo(result.stdout)
166-
167-
if result.stderr:
168-
typer.echo(result.stderr, err=True)
169-
170-
if result.returncode != 0:
171-
raise typer.Exit(code=result.returncode)
172-
173-
return result
174-
175-
176160
def _get_packages_matching_name(prefix: str) -> list[dict[str, str]]:
177161
if "LIBRARIES_IO_API_KEY" not in os.environ:
178162
typer.secho(
@@ -222,7 +206,7 @@ def _display_plugin_list():
222206
plugin_short_name = plugin_full_name.replace("minimal-pba-cli-plugin-", "")
223207

224208
table.add_row(
225-
f"[link=https://capstan-backstage.prod.cirrostratus.org/catalog/default/component/{plugin_full_name}]{plugin_short_name}[/link]",
209+
f"[link=https://pypi.org/project/{plugin_full_name}]{plugin_short_name}[/link]",
226210
plugin["summary"],
227211
str(plugin_latest_version),
228212
output,

src/minimal_pba_cli/upgrade.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from rich.console import Console
22

3-
from minimal_pba_cli.plugin import get_latest_version, run_external_subprocess
3+
from minimal_pba_cli.plugin import get_latest_version
4+
from minimal_pba_cli.util import run_external_subprocess
45

56

67
def upgrade():

src/minimal_pba_cli/util.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import subprocess
2+
3+
import typer
4+
5+
6+
def run_external_subprocess(args: list[str]) -> subprocess.CompletedProcess:
7+
"""Run an external subprocess and return the result."""
8+
9+
result = subprocess.run(args, capture_output=True, encoding="utf-8")
10+
11+
if result.stdout:
12+
typer.echo(result.stdout)
13+
14+
if result.stderr:
15+
typer.echo(result.stderr, err=True)
16+
17+
if result.returncode != 0:
18+
raise typer.Exit(code=result.returncode)
19+
20+
return result
21+
22+
23+

0 commit comments

Comments
 (0)