Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
253 lines (200 loc) · 8.07 KB
/
Copy pathMakefile
File metadata and controls
253 lines (200 loc) · 8.07 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# Makefile for Speechmatics Python SDKs
.PHONY: help
.PHONY: test-all test-rt test-batch test-agent-stt test-tts test-voice
.PHONY: format-all format-rt format-batch format-agent-stt format-flow format-tts format-voice
.PHONY: lint-all lint-rt lint-batch lint-agent-stt lint-flow lint-tts lint-voice
.PHONY: type-check-all type-check-rt type-check-batch type-check-agent-stt type-check-flow type-check-tts type-check-voice
.PHONY: build-all build-rt build-batch build-agent-stt build-flow build-tts build-voice
.PHONY: clean-all clean-rt clean-batch clean-agent-stt clean-flow clean-tts clean-voice
.PHONY: install-dev install-dev-rt install-dev-batch install-dev-agent-stt install-dev-flow install-dev-tts install-dev-voice
help:
@echo "Available commands:"
@echo " help Display this help message"
@echo "Testing:"
@echo " test-all Run tests for all SDKs"
@echo " test-rt Run tests for RT SDK"
@echo " test-batch Run tests for Batch SDK"
@echo " test-agent-stt Run tests for Agent STT SDK"
@echo " test-tts Run tests for TTS SDK"
@echo " test-voice Run tests for Voice Agent SDK"
@echo ""
@echo "Code formatting:"
@echo " format-all Auto-fix formatting for all SDKs"
@echo " format-rt Auto-fix formatting for RT SDK"
@echo " format-batch Auto-fix formatting for Batch SDK"
@echo " format-agent-stt Auto-fix formatting for Agent STT SDK"
@echo " format-flow Auto-fix formatting for Flow SDK"
@echo " format-tts Auto-fix formatting for TTS SDK"
@echo " format-voice Auto-fix formatting for Voice Agent SDK"
@echo ""
@echo "Linting:"
@echo " lint-all Run linting for all SDKs"
@echo " lint-rt Run linting for RT SDK"
@echo " lint-batch Run linting for Batch SDK"
@echo " lint-agent-stt Run linting for Agent STT SDK"
@echo " lint-flow Run linting for Flow SDK"
@echo " lint-tts Run linting for TTS SDK"
@echo " lint-voice Run linting for Voice Agent SDK"
@echo ""
@echo "Type checking:"
@echo " type-check-all Run type checking for all SDKs"
@echo " type-check-rt Run type checking for RT SDK"
@echo " type-check-batch Run type checking for Batch SDK"
@echo " type-check-agent-stt Run type checking for Agent STT SDK"
@echo " type-check-flow Run type checking for Flow SDK"
@echo " type-check-tts Run type checking for TTS SDK"
@echo " type-check-voice Run type checking for Voice Agent SDK"
@echo ""
@echo "Building:"
@echo " build-all Build all SDKs"
@echo " build-rt Build RT SDK"
@echo " build-batch Build Batch SDK"
@echo " build-agent-stt Build Agent STT SDK"
@echo " build-flow Build Flow SDK"
@echo " build-tts Build TTS SDK"
@echo " build-voice Build Voice Agent SDK"
@echo ""
@echo "Cleaning:"
@echo " clean-all Clean all SDKs"
@echo " clean-rt Clean RT SDK build artifacts"
@echo " clean-batch Clean Batch SDK build artifacts"
@echo " clean-agent-stt Clean Agent STT SDK build artifacts"
@echo " clean-flow Clean Flow SDK build artifacts"
@echo " clean-tts Clean TTS SDK build artifacts"
@echo " clean-voice Clean Voice Agent SDK build artifacts"
@echo ""
# Testing targets
test-all: test-rt test-batch test-agent-stt test-tts test-voice
test-rt:
pytest tests/rt/ -v -s
test-batch:
pytest tests/batch/ -v -s
test-agent-stt:
pytest tests/agent_stt/ -v -s
test-tts:
pytest tests/tts/ -v -s
test-voice:
pytest tests/voice/ -v -s
# Formatting targets
format-all: format-rt format-batch format-agent-stt format-flow format-tts format-voice format-tests format-examples
format-rt:
cd sdk/rt/speechmatics && black .
cd sdk/rt/speechmatics && ruff check --fix .
format-batch:
cd sdk/batch/speechmatics && black .
cd sdk/batch/speechmatics && ruff check --fix .
format-agent-stt:
cd sdk/agent_stt/speechmatics && black .
cd sdk/agent_stt/speechmatics && ruff check --fix .
format-flow:
cd sdk/flow/speechmatics && black .
cd sdk/flow/speechmatics && ruff check --fix .
format-tts:
cd sdk/tts/speechmatics && black .
cd sdk/tts/speechmatics && ruff check --fix .
format-voice:
cd sdk/voice/speechmatics && black .
cd sdk/voice/speechmatics && ruff check --fix .
format-tests:
cd tests && black .
cd tests && ruff check --fix .
format-examples:
cd examples && black .
cd examples && ruff check --fix .
# Linting targets
lint-all: lint-rt lint-batch lint-agent-stt lint-flow lint-tts lint-voice
lint-rt:
cd sdk/rt/speechmatics && ruff check .
lint-batch:
cd sdk/batch/speechmatics && ruff check .
lint-agent-stt:
cd sdk/agent_stt/speechmatics && ruff check .
lint-flow:
cd sdk/flow/speechmatics && ruff check .
lint-tts:
cd sdk/tts/speechmatics && ruff check .
lint-voice:
cd sdk/voice/speechmatics && ruff check .
# Type checking targets
type-check-all: type-check-rt type-check-batch type-check-agent-stt type-check-flow type-check-tts type-check-voice
type-check-rt:
cd sdk/rt/speechmatics && mypy .
type-check-batch:
cd sdk/batch/speechmatics && mypy .
type-check-agent-stt:
cd sdk/agent_stt/speechmatics && mypy .
type-check-flow:
cd sdk/flow/speechmatics && mypy .
type-check-tts:
cd sdk/tts/speechmatics && mypy .
type-check-voice:
cd sdk/voice/speechmatics && mypy .
# Installation targets
#
# voice depends on speechmatics-rt>=0.5.3; the local rt package's own dev version (0.0.0)
# never satisfies that, so pip silently replaces the editable rt install with a published
# PyPI wheel the moment voice[dev] installs after it. rt must always be the LAST install
# in any sequence that also installs voice, so the local editable copy is what's left active.
install-dev: install-dev-batch install-dev-agent-stt install-dev-flow install-dev-tts install-dev-voice install-dev-rt
install-dev-rt:
python -m pip install --upgrade pip
python -m pip install -e sdk/rt[dev]
install-dev-batch:
python -m pip install --upgrade pip
python -m pip install -e sdk/batch[dev]
install-dev-agent-stt:
python -m pip install --upgrade pip
python -m pip install -e sdk/agent_stt[dev]
python -m pip install -e sdk/rt
install-dev-flow:
python -m pip install --upgrade pip
python -m pip install -e sdk/flow[dev]
install-dev-tts:
python -m pip install --upgrade pip
python -m pip install -e sdk/tts[dev]
install-dev-voice:
python -m pip install --upgrade pip
python -m pip install -e sdk/voice[dev]
python -m pip install -e sdk/rt
install-build:
python -m pip install --upgrade build
# Building targets
build-all: build-rt build-batch build-agent-stt build-flow build-tts build-voice
build-rt: install-build
cd sdk/rt && python -m build
build-batch: install-build
cd sdk/batch && python -m build
build-agent-stt: install-build
cd sdk/agent_stt && python -m build
build-flow: install-build
cd sdk/flow && python -m build
build-tts: install-build
cd sdk/tts && python -m build
build-voice: install-build
cd sdk/voice && python -m build
# Cleaning targets
clean-all: clean-rt clean-batch clean-agent-stt clean-flow clean-tts clean-voice clean-test clean-examples
clean-rt:
rm -rf sdk/rt/dist sdk/rt/build sdk/rt/*.egg-info
find sdk/rt -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
clean-batch:
rm -rf sdk/batch/dist sdk/batch/build sdk/batch/*.egg-info
find sdk/batch -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
clean-agent-stt:
rm -rf sdk/agent_stt/dist sdk/agent_stt/build sdk/agent_stt/*.egg-info
find sdk/agent_stt -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
clean-flow:
rm -rf sdk/flow/dist sdk/flow/build sdk/flow/*.egg-info
find sdk/flow -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
clean-tts:
rm -rf sdk/tts/dist sdk/tts/build sdk/tts/*.egg-info
find sdk/tts -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
clean-voice:
rm -rf sdk/voice/dist sdk/voice/build sdk/voice/*.egg-info
find sdk/voice -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
clean-test:
find tests -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
rm -rf .pytest_cache
rm -rf .mypy_cache
clean-examples:
find examples -name __pycache__ -exec rm -rf {} + 2>/dev/null || true