deepctl-shared-utils 0.1.11__tar.gz → 0.1.13__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.
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/PKG-INFO +1 -1
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/pyproject.toml +1 -1
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils/__init__.py +1 -1
- deepctl_shared_utils-0.1.13/src/deepctl_shared_utils/diagnostics.py +52 -0
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils/ffprobe.py +7 -2
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils/validation.py +7 -2
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils.egg-info/PKG-INFO +1 -1
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils.egg-info/SOURCES.txt +1 -0
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/README.md +0 -0
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/setup.cfg +0 -0
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils/ffprobe_models.py +0 -0
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils/models.py +0 -0
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils/py.typed +0 -0
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils.egg-info/dependency_links.txt +0 -0
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils.egg-info/requires.txt +0 -0
- {deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "deepctl-shared-utils"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.13" # x-release-please-version
|
|
8
8
|
description = "Shared utilities for deepctl"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Plain-text diagnostic output shared by utilities outside deepctl-core."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
from typing import TextIO
|
|
6
|
+
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def is_non_interactive() -> bool:
|
|
11
|
+
"""Mirror deepctl-core's agent and non-interactive output policy.
|
|
12
|
+
|
|
13
|
+
Shared utilities intentionally do not depend on deepctl-core, so keep this
|
|
14
|
+
lightweight detection aligned with ``deepctl_core.output.is_agentic``.
|
|
15
|
+
"""
|
|
16
|
+
env = os.environ
|
|
17
|
+
|
|
18
|
+
if "--non-interactive" in sys.argv or "--agent-friendly" in sys.argv:
|
|
19
|
+
return True
|
|
20
|
+
if env.get("CI") in ("true", "1"):
|
|
21
|
+
return True
|
|
22
|
+
if env.get("CLAUDECODE") or env.get("CLAUDE_CODE_ENTRYPOINT"):
|
|
23
|
+
return True
|
|
24
|
+
if env.get("CODEX_SANDBOX") or env.get("CODEX_SANDBOX_NETWORK_DISABLED"):
|
|
25
|
+
return True
|
|
26
|
+
if env.get("OR_APP_NAME") == "Aider" or "aider" in env.get("OR_SITE_URL", ""):
|
|
27
|
+
return True
|
|
28
|
+
|
|
29
|
+
score = 0
|
|
30
|
+
if not sys.stdin.isatty():
|
|
31
|
+
score += 1
|
|
32
|
+
if not sys.stdout.isatty():
|
|
33
|
+
score += 1
|
|
34
|
+
if not env.get("TERM") or env.get("TERM") == "dumb":
|
|
35
|
+
score += 1
|
|
36
|
+
if "NO_COLOR" in env:
|
|
37
|
+
score += 1
|
|
38
|
+
|
|
39
|
+
return score >= 3
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def create_diagnostic_console(
|
|
43
|
+
*, file: TextIO | None = None, force_terminal: bool | None = None
|
|
44
|
+
) -> Console:
|
|
45
|
+
"""Create a stderr diagnostic console with the shared plain-text policy."""
|
|
46
|
+
non_interactive = is_non_interactive()
|
|
47
|
+
return Console(
|
|
48
|
+
file=file or sys.stderr,
|
|
49
|
+
force_terminal=force_terminal,
|
|
50
|
+
no_color=non_interactive,
|
|
51
|
+
highlight=not non_interactive,
|
|
52
|
+
)
|
{deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils/ffprobe.py
RENAMED
|
@@ -10,15 +10,20 @@ import subprocess
|
|
|
10
10
|
import tempfile
|
|
11
11
|
from typing import TYPE_CHECKING
|
|
12
12
|
|
|
13
|
-
from rich.console import Console
|
|
14
13
|
from rich.panel import Panel
|
|
15
14
|
|
|
15
|
+
from .diagnostics import create_diagnostic_console
|
|
16
16
|
from .ffprobe_models import AudioFormatInfo, AudioProbeResult, AudioStreamInfo
|
|
17
17
|
|
|
18
18
|
if TYPE_CHECKING:
|
|
19
19
|
from deepctl_core import Config
|
|
20
20
|
|
|
21
|
-
console
|
|
21
|
+
# Diagnostics only: every console.print below is an error, a warning or a
|
|
22
|
+
# progress line -- never a payload -- so it goes to stderr and can never
|
|
23
|
+
# corrupt the machine-readable result a command writes to stdout (#104).
|
|
24
|
+
# deepctl-shared-utils does not depend on deepctl-core, so this local factory
|
|
25
|
+
# mirrors core's agentic/no-color policy instead of importing `stderr_console`.
|
|
26
|
+
console = create_diagnostic_console()
|
|
22
27
|
|
|
23
28
|
|
|
24
29
|
def get_ffprobe_path(config: Config | None = None) -> str | None:
|
{deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils/validation.py
RENAMED
|
@@ -6,11 +6,16 @@ from pathlib import Path
|
|
|
6
6
|
from urllib.parse import urlparse
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
|
-
from rich.console import Console
|
|
10
9
|
|
|
10
|
+
from .diagnostics import create_diagnostic_console
|
|
11
11
|
from .models import FileInfo
|
|
12
12
|
|
|
13
|
-
console
|
|
13
|
+
# Diagnostics only: every console.print below is an error, a warning or a
|
|
14
|
+
# progress line -- never a payload -- so it goes to stderr and can never
|
|
15
|
+
# corrupt the machine-readable result a command writes to stdout (#104).
|
|
16
|
+
# deepctl-shared-utils does not depend on deepctl-core, so this local factory
|
|
17
|
+
# mirrors core's agentic/no-color policy instead of importing `stderr_console`.
|
|
18
|
+
console = create_diagnostic_console()
|
|
14
19
|
|
|
15
20
|
# Supported audio file extensions
|
|
16
21
|
SUPPORTED_AUDIO_EXTENSIONS = {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils/models.py
RENAMED
|
File without changes
|
{deepctl_shared_utils-0.1.11 → deepctl_shared_utils-0.1.13}/src/deepctl_shared_utils/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|