checkup 0.5.0__tar.gz → 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {checkup-0.5.0 → checkup-0.5.1}/PKG-INFO +1 -1
- {checkup-0.5.0 → checkup-0.5.1}/pyproject.toml +1 -1
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/__init__.py +2 -1
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/commands/__init__.py +2 -0
- checkup-0.5.1/src/checkup/cli/commands/plugins.py +49 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/registry/__init__.py +2 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/registry/discovery.py +45 -0
- {checkup-0.5.0 → checkup-0.5.1}/README.md +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/__init__.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/commands/config.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/commands/init.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/commands/run.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/commands/schema.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/config_wizard/__init__.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/config_wizard/_common.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/config_wizard/create.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/config_wizard/edit.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/executor.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/cli/utils.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/config.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/configuration/__init__.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/configuration/env.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/configuration/io.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/configuration/models.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/configuration/schema.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/errors.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/executor/__init__.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/executor/batch_executors.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/executor/metric_calculator.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/executor/provider_executor.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/executor/state.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/graph.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/hub.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/materializers/__init__.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/materializers/base.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/materializers/console.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/materializers/csv_file.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/materializers/database.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/materializers/html_report.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/measurement.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/metric.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/provider.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/providers/__init__.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/providers/tags.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/templates/metrics_report.html +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/types.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/utils.py +0 -0
- {checkup-0.5.0 → checkup-0.5.1}/src/checkup/validators.py +0 -0
|
@@ -7,7 +7,7 @@ from typing import Annotated
|
|
|
7
7
|
|
|
8
8
|
import typer
|
|
9
9
|
|
|
10
|
-
from checkup.cli.commands import config, init, run, schema
|
|
10
|
+
from checkup.cli.commands import config, init, plugins, run, schema
|
|
11
11
|
|
|
12
12
|
app = typer.Typer(
|
|
13
13
|
name="checkup",
|
|
@@ -36,3 +36,4 @@ app.command()(run)
|
|
|
36
36
|
app.command()(init)
|
|
37
37
|
app.command()(config)
|
|
38
38
|
app.command()(schema)
|
|
39
|
+
app.command()(plugins)
|
|
@@ -4,12 +4,14 @@ CLI commands.
|
|
|
4
4
|
|
|
5
5
|
from checkup.cli.commands.config import config
|
|
6
6
|
from checkup.cli.commands.init import init
|
|
7
|
+
from checkup.cli.commands.plugins import plugins
|
|
7
8
|
from checkup.cli.commands.run import run
|
|
8
9
|
from checkup.cli.commands.schema import schema
|
|
9
10
|
|
|
10
11
|
__all__ = [
|
|
11
12
|
"config",
|
|
12
13
|
"init",
|
|
14
|
+
"plugins",
|
|
13
15
|
"run",
|
|
14
16
|
"schema",
|
|
15
17
|
]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Plugins command. List installed checkup plugins.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from rich.console import Console
|
|
6
|
+
from rich.table import Table
|
|
7
|
+
|
|
8
|
+
from checkup.registry import get_registry
|
|
9
|
+
|
|
10
|
+
console = Console()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def plugins() -> None:
|
|
14
|
+
"""
|
|
15
|
+
List installed checkup plugins.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
all_plugins = get_registry().list_plugins()
|
|
19
|
+
all_plugins.pop("checkup", None)
|
|
20
|
+
|
|
21
|
+
if not all_plugins:
|
|
22
|
+
console.print("[yellow]No checkup plugins installed[/yellow]")
|
|
23
|
+
return
|
|
24
|
+
|
|
25
|
+
kinds = [
|
|
26
|
+
("Providers", "providers"),
|
|
27
|
+
("Metrics", "metrics"),
|
|
28
|
+
("Materializers", "materializers"),
|
|
29
|
+
]
|
|
30
|
+
populated_kinds = [ # Hide columns that are empty
|
|
31
|
+
(header, attr)
|
|
32
|
+
for header, attr in kinds
|
|
33
|
+
if any(getattr(p, attr) for p in all_plugins.values())
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
table = Table(title="Installed checkup plugins")
|
|
37
|
+
table.add_column("Plugin", style="bold", overflow="fold")
|
|
38
|
+
table.add_column("Version", overflow="fold")
|
|
39
|
+
for header, _ in populated_kinds:
|
|
40
|
+
table.add_column(header, overflow="fold")
|
|
41
|
+
|
|
42
|
+
for name, plugin in all_plugins.items():
|
|
43
|
+
table.add_row(
|
|
44
|
+
name,
|
|
45
|
+
plugin.version or "",
|
|
46
|
+
*("\n".join(getattr(plugin, attr)) for _, attr in populated_kinds),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
console.print(table)
|
|
@@ -3,6 +3,7 @@ Plugin discovery via Python entry points.
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
|
+
from dataclasses import dataclass, field
|
|
6
7
|
from importlib.metadata import entry_points
|
|
7
8
|
from typing import TYPE_CHECKING
|
|
8
9
|
|
|
@@ -13,6 +14,19 @@ if TYPE_CHECKING:
|
|
|
13
14
|
|
|
14
15
|
logger = logging.getLogger(__name__)
|
|
15
16
|
|
|
17
|
+
|
|
18
|
+
@dataclass
|
|
19
|
+
class Plugin:
|
|
20
|
+
"""
|
|
21
|
+
A distribution registering one or more checkup entry points.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
version: str | None
|
|
25
|
+
providers: list[str] = field(default_factory=list)
|
|
26
|
+
metrics: list[str] = field(default_factory=list)
|
|
27
|
+
materializers: list[str] = field(default_factory=list)
|
|
28
|
+
|
|
29
|
+
|
|
16
30
|
# Entry point group names
|
|
17
31
|
PROVIDERS_GROUP = "checkup.providers"
|
|
18
32
|
METRICS_GROUP = "checkup.metrics"
|
|
@@ -137,6 +151,37 @@ class PluginRegistry:
|
|
|
137
151
|
|
|
138
152
|
return self._list_entry_point_names(MATERIALIZERS_GROUP)
|
|
139
153
|
|
|
154
|
+
def list_plugins(self) -> dict[str, Plugin]:
|
|
155
|
+
"""
|
|
156
|
+
List installed plugins grouped by distribution.
|
|
157
|
+
|
|
158
|
+
Walks all checkup entry-point groups and groups them by the
|
|
159
|
+
distribution that registers them. Does not load plugin code.
|
|
160
|
+
"""
|
|
161
|
+
|
|
162
|
+
groups = {
|
|
163
|
+
"providers": PROVIDERS_GROUP,
|
|
164
|
+
"metrics": METRICS_GROUP,
|
|
165
|
+
"materializers": MATERIALIZERS_GROUP,
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
plugins: dict[str, Plugin] = {}
|
|
169
|
+
|
|
170
|
+
for kind, group in groups.items():
|
|
171
|
+
for ep in entry_points(group=group):
|
|
172
|
+
dist = ep.dist
|
|
173
|
+
dist_name = dist.name if dist else "unknown"
|
|
174
|
+
dist_version = dist.version if dist else None
|
|
175
|
+
|
|
176
|
+
plugin = plugins.setdefault(dist_name, Plugin(version=dist_version))
|
|
177
|
+
getattr(plugin, kind).append(ep.name)
|
|
178
|
+
|
|
179
|
+
for plugin in plugins.values():
|
|
180
|
+
for kind in groups:
|
|
181
|
+
getattr(plugin, kind).sort()
|
|
182
|
+
|
|
183
|
+
return dict(sorted(plugins.items()))
|
|
184
|
+
|
|
140
185
|
def list_compatible_metric_names(self, provider_names: list[str]) -> list[str]:
|
|
141
186
|
"""
|
|
142
187
|
List metric names compatible with the given providers.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|