-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
201 lines (191 loc) · 6.31 KB
/
pyproject.toml
File metadata and controls
201 lines (191 loc) · 6.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
[project]
name = "dalston"
version = "0.1.0"
description = "Modular, self-hosted audio transcription server"
requires-python = ">=3.11,<3.14"
dependencies = [
"pydantic==2.13.2",
"pydantic-settings==2.13.1",
"structlog>=24.0.0",
# OpenTelemetry core (M19 distributed tracing)
# Pinned: OTel core 1.X.Y must match instrumentation 0.(X+21)bY exactly.
# Loose ranges cause pip resolver backtracking (20+ min in CI).
"opentelemetry-api==1.41.0",
"opentelemetry-sdk==1.41.0",
"opentelemetry-exporter-otlp-proto-grpc==1.41.0",
# Prometheus metrics (M20)
"prometheus-client==0.25.0",
]
[project.optional-dependencies]
gateway = [
"fastapi>=0.135.0",
"uvicorn>=0.41.0",
"python-multipart>=0.0.6",
"redis>=7.0.0",
"httpx>=0.26.0",
"pyyaml>=6.0", # For engine catalog (M31)
"sqlalchemy[asyncio]>=2.0.0",
"asyncpg>=0.31.0",
"aiosqlite>=0.20.0", # Lite-mode SQLite async driver
"greenlet>=3.3.0",
"aioboto3>=15.5.0",
"types-aiobotocore-s3>=3.0.0",
"websockets>=16.0", # For realtime WebSocket proxy
"tinytag>=2.2.1", # Audio metadata extraction (CVE-2026-33671: SYLT loop DoS)
"huggingface_hub>=1.0.0", # For HF card routing (M40.5)
# OpenTelemetry auto-instrumentation (M19)
"opentelemetry-instrumentation-fastapi==0.62b0",
"opentelemetry-instrumentation-redis==0.62b0",
"opentelemetry-instrumentation-httpx==0.62b0",
"opentelemetry-instrumentation-sqlalchemy==0.62b0",
"alembic>=1.13.0",
]
orchestrator = [
"redis>=7.0.0",
"sqlalchemy[asyncio]>=2.0.0",
"asyncpg>=0.31.0",
"aiosqlite>=0.20.0", # Lite-mode SQLite async driver
"aioboto3>=15.5.0",
"httpx>=0.26.0",
"fastapi>=0.135.0", # Required for importing gateway.services
"python-multipart>=0.0.6", # Required by FastAPI for form data
"websockets>=16.0", # Required by gateway module
"tinytag>=2.2.1", # Required by gateway.services.audio_probe
"aiohttp>=3.13.4", # For lightweight HTTP server (metrics endpoint)
"pyyaml>=6.0", # For engine catalog YAML parsing (M29)
"alembic>=1.13.0",
]
engine-sdk = [
"redis>=7.0.0",
"boto3>=1.35.0", # Floor only — aioboto3 pins compatible botocore range
"pyyaml>=6.0", # For engine.yaml loading (M30)
# OpenTelemetry instrumentation (M19)
"opentelemetry-instrumentation-redis==0.62b0",
"opentelemetry-instrumentation-boto3sqs==0.62b0",
# HTTP server for engine interface contract (M79)
"fastapi>=0.115.0",
"uvicorn>=0.34.0",
"python-multipart>=0.0.20",
]
realtime-sdk = [
"websockets>=16.0",
"redis>=7.0.0",
"numpy>=1.24.0",
# NOTE: onnxruntime is NOT listed here on purpose. It caused GPU namespace
# collisions when GPU engines installed realtime-sdk (CPU onnxruntime
# overwrote onnxruntime-gpu files). Each engine brings its own runtime:
# - ONNX engine: onnxruntime-gpu (GPU) or onnxruntime (CPU)
# - Other engines: don't need onnxruntime at all
# The realtime_sdk.vad module lazy-imports onnxruntime at runtime.
"soxr>=1.0.0", # High-quality sample rate conversion (libsoxr)
"aioboto3>=15.5.0", # S3 storage for audio/transcript persistence
"types-aiobotocore-s3>=3.0.0",
"audioop-lts>=0.2.1;python_version>='3.13'", # audioop removed in Python 3.13
]
session-router = [
"redis>=7.0.0",
]
tools = [
"nvidia-ml-py3>=7.352.0", # pynvml for VRAM calibration (M84)
"requests>=2.33.0", # HTTP client for calibration script (CVE-2026-25645)
"numpy>=1.24.0", # Audio generation + linear regression
]
dev = [
"pytest>=9.0.3", # CVE-2025-71176: vulnerable tmpdir handling
"pytest-asyncio>=0.23.0",
"pytest-httpx>=0.30.0",
"httpx>=0.26.0",
"redis>=7.0.0",
"alembic>=1.13.0",
"ruff>=0.9.0",
"pre-commit>=4.0.0",
"numpy>=1.24.0", # For VAD tests
"soxr>=1.0.0", # For resampling tests
"soundfile>=0.12.0", # For audio format tests (M81)
"jsonschema>=4.0.0", # For engine YAML validation (M30)
# OpenTelemetry test utilities (M19)
"opentelemetry-test-utils==0.62b0",
# Pinned OpenAI SDK for M61 contract suite
"openai==2.32.0",
# Pinned ElevenLabs SDK for M62 contract suite
"elevenlabs==2.43.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.ruff]
line-length = 88
target-version = "py311"
exclude = [
".git",
".venv",
".venv312",
"__pycache__",
"alembic/versions",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # function call in default argument (FastAPI Depends pattern)
]
[tool.ruff.lint.isort]
known-first-party = ["dalston"]
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
markers = [
"e2e: end-to-end tests requiring live Docker stack",
"integration: integration tests requiring Redis or other services",
"benchmark: performance and load benchmarks (slow, run explicitly)",
]
addopts = "-m 'not e2e and not benchmark'"
[tool.mypy]
python_version = "3.11"
warn_return_any = false
warn_unused_ignores = false
disallow_untyped_defs = false
ignore_missing_imports = true
exclude = [
"alembic/",
"engines/",
]
# Ignore errors in tools (scaffold has dynamic typing)
[[tool.mypy.overrides]]
module = "dalston.tools.*"
ignore_errors = true
# Redis async client typing: redis-py uses union types (Awaitable[T] | T)
# that confuse mypy. Ignore errors in Redis-heavy modules.
# TODO: Gradually enable type checking as modules are fixed
[[tool.mypy.overrides]]
module = [
"dalston.session_router.*",
"dalston.realtime_sdk.*",
"dalston.orchestrator.*",
"dalston.engine_sdk.*",
"dalston.common.streams",
"dalston.common.streams_sync",
"dalston.common.durable_events",
"dalston.common.s3",
"dalston.metrics_exporter",
"dalston.logging",
]
ignore_errors = true
# Gateway modules with typing issues (mostly arg-type from optional params)
[[tool.mypy.overrides]]
module = [
"dalston.gateway.api.*",
"dalston.gateway.services.*",
"dalston.gateway.main",
"dalston.gateway.dependencies",
]
ignore_errors = true