-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
150 lines (137 loc) · 4.22 KB
/
Copy pathpyproject.toml
File metadata and controls
150 lines (137 loc) · 4.22 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
[project]
name = "vocagateway"
version = "0.2.0"
description = "Headless local transcription gateway for Voca clients (vocaphone, desktop apps)"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"fastapi>=0.116,<1",
# WebUI templates (app/templates) — keeps markup out of the Python
# fragment modules, which only prepare data and pick a template.
"jinja2>=3.1,<4",
# Multilingual sentence boundaries with per-language abbreviation lists, so
# transcript styling does not carry a hand-written English word list.
"pysbd>=0.3.4,<0.4",
"python-multipart>=0.0.9,<1",
# Public Suffix List snapshot for recognising addresses in a transcript.
"qrcode>=7.4,<9",
"tldextract>=5,<6",
"uvicorn[standard]>=0.35,<1",
]
[project.optional-dependencies]
engines = [
"faster-whisper>=1.2,<2",
# sherpa-onnx declares no dependencies of its own, so numpy would otherwise
# reach this extra only by way of faster-whisper's onnxruntime. Both engine
# call sites work without it; naming it here keeps the vectorized path
# guaranteed for real deployments instead of incidental.
"numpy>=1.21,<3",
"moonshine-voice>=0.1.5,<0.2",
"sherpa-onnx>=1.13.4,<2",
"sherpa-onnx-bin>=1.13.4,<2",
]
apple = [
"mlx-audio[stt]>=0.4.6,<0.5; sys_platform == 'darwin' and platform_machine == 'arm64'",
]
[project.scripts]
vocagateway = "app.cli:serve"
vocagateway-status = "app.cli:status"
vocagateway-diagnostics = "app.cli:diagnostics"
vocagateway-cleanup = "app.cli:cleanup"
vocagateway-token = "app.cli:token"
# Deprecated aliases for one cycle so existing `uv run vocaphone-*` / phone
# justfiles keep working. Prefer the vocagateway* names above.
vocaphone-server = "app.cli:serve"
vocaphone-status = "app.cli:status"
vocaphone-diagnostics = "app.cli:diagnostics"
vocaphone-cleanup = "app.cli:cleanup"
vocaphone-token = "app.cli:token"
[dependency-groups]
dev = [
"flake8-pyproject>=1.2.4",
"httpx>=0.28,<1",
# starlette.testclient (used for WebSocket streaming tests) prefers this
# over plain httpx; without it every run prints a deprecation warning.
"httpx2>=2,<3",
"mypy>=1.17,<2",
# 9.0.3 is the floor that clears CVE-2025-71176 (tmpdir handling), which
# `just package` audits for.
"pytest>=9.0.3,<10",
"pytest-asyncio>=1.1,<2",
# `just unit` runs the suite across cores.
"pytest-xdist>=3.8,<4",
"ruff>=0.12,<1",
# WPS provides stricter complexity/readability checks. Its optional MCP
# server explains unfamiliar violations locally to coding agents.
"wemake-python-styleguide[mcp]>=1.8,<2",
]
[tool.pytest.ini_options]
addopts = "-q"
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM", "ASYNC"]
ignore = ["ASYNC240"]
[tool.ruff.lint.flake8-bugbear]
# `ctx: GatewayContext = Depends(get_context)` is the standard FastAPI DI
# pattern for reaching GatewayContext from a route handler (see
# app/context.py) — Depends() is a cheap, side-effect-free call, not the
# mutable-default footgun B008 guards against.
extend-immutable-calls = ["fastapi.Depends"]
[tool.mypy]
python_version = "3.12"
strict = true
plugins = ["pydantic.mypy"]
packages = ["app"]
[[tool.mypy.overrides]]
module = ["mlx_audio.*", "sherpa_onnx"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"ctranslate2",
"faster_whisper",
"faster_whisper.*",
"moonshine_voice",
"moonshine_voice.*",
# Arrives with the `engines` extra; both call sites fall back without it.
"numpy",
"pysbd",
"pysbd.*",
"qrcode",
"qrcode.*",
]
ignore_missing_imports = true
[tool.flake8]
select = ["WPS", "E999"]
max-line-length = 100
max-arguments = 6
max-local-variables = 16
max-returns = 5
max-expressions = 15
max-methods = 23
max-line-complexity = 51
max-jones-score = 19
max-imports = 20
max-try-body-length = 17
max-raises = 6
max-cognitive-score = 51
max-annotation-complexity = 4
max-tuple-unpack-length = 5
max-imported-names = 50
max-import-from-members = 8
max-base-classes = 3
max-decorators = 5
max-asserts = 5
max-module-members = 31
per-file-ignores = [
"app/schemas.py: WPS202",
"app/main.py: WPS201, WPS235",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["app"]