tabsdata-cli 2.0.0__cp312-abi3-win_amd64.whl
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.
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/__init__.py +5 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/_registry.py +78 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/assets/manifest/BANNER +5 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/assets/manifest/LICENSE +3 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/assets/manifest/README-PyPi.md +8 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/assets/manifest/RELEASE-NOTES +1 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/assets/manifest/THIRD-PARTY +3 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/assets/manifest/VERSION +1 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/cli_utils.py +993 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/shell.py +390 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/__init__.py +3 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/auth_group.py +197 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/cli.py +508 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/collection_group.py +458 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/config_utils.py +93 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/connection_group.py +159 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/examples_group.py +206 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/execution_utils.py +429 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/fn_group.py +1109 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/fnrun_group.py +285 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/group_group.py +184 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/metrics_group.py +323 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/permission_group.py +259 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/plan_group.py +324 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/project_group.py +170 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/role_group.py +630 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/settings_group.py +344 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/table_group.py +600 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/trigger_group.py +338 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/trx_group.py +329 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/user_group.py +200 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/td/worker_group.py +185 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/cli/template.py +781 -0
- tabsdata_cli-2.0.0.data/purelib/tabsdatak/py.typed +0 -0
- tabsdata_cli-2.0.0.dist-info/METADATA +39 -0
- tabsdata_cli-2.0.0.dist-info/RECORD +39 -0
- tabsdata_cli-2.0.0.dist-info/WHEEL +5 -0
- tabsdata_cli-2.0.0.dist-info/licenses/src/main/python/tabsdatak/cli/assets/manifest/LICENSE +3 -0
- tabsdata_cli-2.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright 2026 Tabsdata Inc.
|
|
3
|
+
#
|
|
4
|
+
|
|
5
|
+
"""Decorator + registry for top-level ``tdk`` CLI command groups.
|
|
6
|
+
|
|
7
|
+
Annotating a Click command/group with :func:`cli_command` appends it to
|
|
8
|
+
:data:`_CLI_COMMAND_REGISTRY` at import time; :func:`collect_cli_commands`
|
|
9
|
+
returns everything registered. The root ``tdk`` group (see
|
|
10
|
+
:mod:`tabsdatak.cli.td.cli`) imports the built-in command modules for their
|
|
11
|
+
``@cli_command`` side effects and then attaches whatever the registry holds, so
|
|
12
|
+
there is no manual ``add_command`` list to keep in sync -- a new command just
|
|
13
|
+
needs the annotation.
|
|
14
|
+
|
|
15
|
+
Enterprise-tier variants contribute the same way: their command modules
|
|
16
|
+
annotate their own groups with :func:`cli_command`, and a
|
|
17
|
+
``tabsdatak.extensions.variant.cli.commands`` module (which ships only when the
|
|
18
|
+
variant is installed) imports them for the side effect.
|
|
19
|
+
:func:`collect_cli_commands` imports that module best-effort, so a variant's
|
|
20
|
+
commands surface only where the variant is installed -- open source names
|
|
21
|
+
nothing edition-specific.
|
|
22
|
+
This rides the same ``tabsdatak.extensions.variant.cli`` package that
|
|
23
|
+
``variant_action_classes()`` in :mod:`tabsdatak.cli.td.config_utils` already
|
|
24
|
+
uses for variant *actions*; commands live in a sibling ``commands`` module so
|
|
25
|
+
the actions path never depends on whatever the command module imports.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from __future__ import annotations
|
|
29
|
+
|
|
30
|
+
import importlib
|
|
31
|
+
import logging
|
|
32
|
+
from typing import TYPE_CHECKING
|
|
33
|
+
|
|
34
|
+
if TYPE_CHECKING:
|
|
35
|
+
import click
|
|
36
|
+
|
|
37
|
+
logger = logging.getLogger(__name__)
|
|
38
|
+
|
|
39
|
+
# Populated by @cli_command at import time; read by collect_cli_commands().
|
|
40
|
+
_CLI_COMMAND_REGISTRY: list["click.Command"] = []
|
|
41
|
+
|
|
42
|
+
# Importing this module registers the installed variant's annotated commands.
|
|
43
|
+
# Present only when an enterprise-tier variant is installed.
|
|
44
|
+
_VARIANT_CLI_COMMANDS = "tabsdatak.extensions.variant.cli.commands"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def cli_command(command: "click.Command") -> "click.Command":
|
|
48
|
+
"""Register a top-level ``tdk`` CLI command/group for auto-collection.
|
|
49
|
+
|
|
50
|
+
Apply *above* ``@click.group(...)`` / ``@click.command(...)`` so the
|
|
51
|
+
decorated object is the built Click command::
|
|
52
|
+
|
|
53
|
+
@cli_command
|
|
54
|
+
@click.group()
|
|
55
|
+
def auth():
|
|
56
|
+
...
|
|
57
|
+
|
|
58
|
+
Returns the command unchanged so it stays usable directly.
|
|
59
|
+
"""
|
|
60
|
+
_CLI_COMMAND_REGISTRY.append(command)
|
|
61
|
+
return command
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def collect_cli_commands() -> list["click.Command"]:
|
|
65
|
+
"""Return every ``@cli_command``-annotated command to attach to ``tdk``.
|
|
66
|
+
|
|
67
|
+
Built-in commands self-register when their modules are imported (the root
|
|
68
|
+
CLI imports them). Variant commands self-register when the variant command
|
|
69
|
+
module is imported here -- best-effort, absent in open source. A broken
|
|
70
|
+
variant is logged and skipped so it can never break the core CLI.
|
|
71
|
+
"""
|
|
72
|
+
try:
|
|
73
|
+
importlib.import_module(_VARIANT_CLI_COMMANDS)
|
|
74
|
+
except ImportError:
|
|
75
|
+
pass # no variant installed -- open source has no edition-specific commands
|
|
76
|
+
except Exception as e: # never let a variant break the core CLI
|
|
77
|
+
logger.warning("Skipping variant CLI commands: %s", e)
|
|
78
|
+
return list(_CLI_COMMAND_REGISTRY)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Release notes available at https://tabsdata.com/release-notes#2.0.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.0.0
|