deepctl-cmd-debug-toolkit 0.1.0__py3-none-any.whl → 0.5.0__py3-none-any.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.
@@ -8,7 +8,10 @@ import sys
8
8
  from typing import Any
9
9
 
10
10
  import click
11
- from deepctl_core import AuthManager, BaseGroupCommand, Config
11
+ from deepctl_core import AuthenticationError, AuthManager, BaseGroupCommand, Config
12
+
13
+ # Already loaded with BaseGroupCommand (deepctl_core.base_command imports it).
14
+ from deepctl_core.hosts import DEFAULT_BASE_URL
12
15
  from rich.console import Console
13
16
 
14
17
  from .fetcher import get_cached_manifest, get_or_fetch_script, refresh_manifest
@@ -16,6 +19,9 @@ from .models import ToolkitScript
16
19
 
17
20
  console = Console()
18
21
 
22
+ # The streaming endpoint the examples point at, built from the one default.
23
+ _LISTEN_WS_URL = DEFAULT_BASE_URL.replace("https://", "wss://", 1) + "/v1/listen"
24
+
19
25
 
20
26
  class ToolkitCommand(BaseGroupCommand):
21
27
  """Runs field engineering scripts from deepgram/support-toolkit."""
@@ -35,8 +41,8 @@ class ToolkitCommand(BaseGroupCommand):
35
41
 
36
42
  examples = [
37
43
  "dg debug toolkit refresh",
38
- "dg debug toolkit latency wss://api.deepgram.com/v1/listen",
39
- "dg debug toolkit latency wss://api.deepgram.com/v1/listen --duration=60",
44
+ f"dg debug toolkit latency {_LISTEN_WS_URL}",
45
+ f"dg debug toolkit latency {_LISTEN_WS_URL} --duration=60",
40
46
  ]
41
47
 
42
48
  def setup_commands(self) -> list[click.Command]:
@@ -131,8 +137,10 @@ def _make_script_command(name: str, entry: ToolkitScript) -> click.Command:
131
137
  api_key = AuthManager(Config()).get_api_key()
132
138
  if api_key:
133
139
  env["DEEPGRAM_API_KEY"] = api_key
134
- except Exception:
135
- pass # Script will surface its own missing-key error
140
+ except AuthenticationError as exc:
141
+ console.print(
142
+ f"[yellow]Could not provide Deepgram credentials:[/yellow] {exc}"
143
+ )
136
144
 
137
145
  result = subprocess.run(
138
146
  [sys.executable, str(script_path)] + list(script_args),
@@ -9,7 +9,6 @@ import time
9
9
  from pathlib import Path
10
10
  from typing import TYPE_CHECKING
11
11
 
12
- import httpx
13
12
  import platformdirs
14
13
  from rich.console import Console
15
14
 
@@ -50,6 +49,8 @@ def _fetch_github_contents(path: str) -> tuple[str, bytes]:
50
49
 
51
50
  Returns (blob_sha, raw_bytes). Raises on any HTTP error or SHA mismatch.
52
51
  """
52
+ import httpx
53
+
53
54
  url = f"{GITHUB_API_BASE}/{path}"
54
55
  resp = httpx.get(
55
56
  url,
@@ -72,10 +73,18 @@ def _fetch_github_contents(path: str) -> tuple[str, bytes]:
72
73
 
73
74
 
74
75
  def get_cached_manifest() -> ToolkitManifest | None:
75
- """Return the cached manifest if it exists and is fresh, else None."""
76
- if not _MANIFEST_CACHE.exists():
76
+ """Return the cached manifest if it exists and is fresh, else None.
77
+
78
+ An unreadable cache (a HOME the user can't read) counts as no cache:
79
+ loading the debug group, and every `dg debug <sub> --help`, reads this.
80
+ """
81
+ try:
82
+ if not _MANIFEST_CACHE.exists():
83
+ return None
84
+ has_age = _MANIFEST_AGE.exists()
85
+ except OSError:
77
86
  return None
78
- if _MANIFEST_AGE.exists():
87
+ if has_age:
79
88
  try:
80
89
  age = float(_MANIFEST_AGE.read_text().strip())
81
90
  if time.time() - age > _MANIFEST_TTL:
@@ -1,17 +1,18 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepctl-cmd-debug-toolkit
3
- Version: 0.1.0
3
+ Version: 0.5.0
4
4
  Summary: Toolkit subcommand for dg debug — runs field support scripts from deepgram/support-toolkit
5
5
  Author-email: Deepgram <devrel@deepgram.com>
6
6
  License-Expression: MIT
7
7
  Requires-Python: >=3.10
8
8
  Description-Content-Type: text/markdown
9
- Requires-Dist: deepctl-core>=0.1.10
10
- Requires-Dist: httpx>=0.27.0
11
- Requires-Dist: pydantic>=2.10.1
12
- Requires-Dist: platformdirs>=4.0.0
13
- Requires-Dist: rich>=13.9.4
14
- Requires-Dist: click>=8.1.7
9
+ Requires-Dist: deepctl==0.5.0
10
+ Requires-Dist: deepctl-core==0.5.0
11
+ Requires-Dist: httpx<1,>=0.27.0
12
+ Requires-Dist: pydantic<3,>=2.10.1
13
+ Requires-Dist: platformdirs<5,>=4.0.0
14
+ Requires-Dist: rich<16,>=13.9.4
15
+ Requires-Dist: click<9,>=8.2.0
15
16
  Provides-Extra: dev
16
17
  Requires-Dist: pytest>=8.3.3; extra == "dev"
17
18
  Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
@@ -55,11 +56,11 @@ pipx run deepctl --help
55
56
 
56
57
  ## Dependencies
57
58
 
58
- - `httpx>=0.27.0`
59
- - `pydantic>=2.10.1`
60
- - `platformdirs>=4.0.0`
61
- - `rich>=13.9.4`
62
- - `click>=8.1.7`
59
+ - `httpx>=0.27.0,<1`
60
+ - `pydantic>=2.10.1,<3`
61
+ - `platformdirs>=4.0.0,<5`
62
+ - `rich>=13.9.4,<16`
63
+ - `click>=8.2.0,<9`
63
64
 
64
65
  ## License
65
66
 
@@ -0,0 +1,9 @@
1
+ deepctl_cmd_debug_toolkit/__init__.py,sha256=koXSDCTIRP3qm6Aa__0bGkrfMGP0QQK53EEwk5VbKcI,162
2
+ deepctl_cmd_debug_toolkit/command.py,sha256=pEd3qf_oX7UqgC1jWD0Hgd5iuoMunCYVC8KSHdgW-7I,5269
3
+ deepctl_cmd_debug_toolkit/fetcher.py,sha256=kzoVoVftL0o-AjzKO3UHzEgkd2lD21Bx6gVEf8qyUjY,5075
4
+ deepctl_cmd_debug_toolkit/models.py,sha256=boToXfTJWbRXmZdbmwhSByul3V8TySUGTaSlp-IkAjI,499
5
+ deepctl_cmd_debug_toolkit-0.5.0.dist-info/METADATA,sha256=F1aPOcCw17ZTPblhs2f3IlEi8Pf95uKgoRqO9gzY5eM,1651
6
+ deepctl_cmd_debug_toolkit-0.5.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
7
+ deepctl_cmd_debug_toolkit-0.5.0.dist-info/entry_points.txt,sha256=L1Lk43utOWOLoEMRdwWC7OX0re75omA4y9ZIwAvJyw8,87
8
+ deepctl_cmd_debug_toolkit-0.5.0.dist-info/top_level.txt,sha256=nY0EOsmsW2gdj-lQZNzh8bhkrGXZMvnNpLLy6FJJpfQ,26
9
+ deepctl_cmd_debug_toolkit-0.5.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (82.0.1)
2
+ Generator: setuptools (84.2.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,9 +0,0 @@
1
- deepctl_cmd_debug_toolkit/__init__.py,sha256=koXSDCTIRP3qm6Aa__0bGkrfMGP0QQK53EEwk5VbKcI,162
2
- deepctl_cmd_debug_toolkit/command.py,sha256=kXK386bSHtWcHsn_c8C3Lwql5ycSGC8VRttAEemXHgw,4909
3
- deepctl_cmd_debug_toolkit/fetcher.py,sha256=xeeefB8Ev672k0VCEEVFC_89soP_1gk5jvnY1Lu3AOQ,4832
4
- deepctl_cmd_debug_toolkit/models.py,sha256=boToXfTJWbRXmZdbmwhSByul3V8TySUGTaSlp-IkAjI,499
5
- deepctl_cmd_debug_toolkit-0.1.0.dist-info/METADATA,sha256=KUbeEu83nRjHWM-wBo3ZlngNRnPJeTrOT51O5lI-84Y,1590
6
- deepctl_cmd_debug_toolkit-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
7
- deepctl_cmd_debug_toolkit-0.1.0.dist-info/entry_points.txt,sha256=L1Lk43utOWOLoEMRdwWC7OX0re75omA4y9ZIwAvJyw8,87
8
- deepctl_cmd_debug_toolkit-0.1.0.dist-info/top_level.txt,sha256=nY0EOsmsW2gdj-lQZNzh8bhkrGXZMvnNpLLy6FJJpfQ,26
9
- deepctl_cmd_debug_toolkit-0.1.0.dist-info/RECORD,,