-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmise.toml
More file actions
456 lines (375 loc) · 14.4 KB
/
mise.toml
File metadata and controls
456 lines (375 loc) · 14.4 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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
[tools]
ruff = "0.15.10"
[env]
PYTHON_BIN = "python3"
# --- Dependencies ---
[tasks.deps]
description = "Install JS/TS dependencies"
run = "pnpm install"
# --- Formatting ---
[tasks."format:go"]
description = "Format Go code in all modules"
run = """
#!/usr/bin/env bash
set -euo pipefail
while IFS= read -r moddir; do
echo "==> gofmt ${moddir}"
gofmt -w "${moddir}"
done < <(find . -name go.mod -not -path './node_modules/*' -exec dirname {} \\; | sort)
"""
[tasks."format:py"]
description = "Format Python SDK code"
run = "ruff format python/ python-providers/ python-frameworks/"
[tasks."format:cs"]
description = "Format .NET SDK code"
run = "dotnet format dotnet/Sigil.DotNet.sln"
[tasks.format]
description = "Format all code"
depends = ["format:go", "format:py", "format:cs"]
# --- Linting ---
[tasks."lint:go"]
description = "Lint Go code in all modules"
run = """
#!/usr/bin/env bash
set -euo pipefail
while IFS= read -r moddir; do
if [[ -z "$(cd "${moddir}" && GOWORK=off go list ./... 2>/dev/null || true)" ]]; then
echo "==> skip golangci-lint ${moddir} (no Go packages)"
continue
fi
echo "==> golangci-lint ${moddir}"
(cd "${moddir}" && GOWORK=off golangci-lint run ./...)
done < <(find . -name go.mod -not -path './node_modules/*' -exec dirname {} \\; | sort)
"""
[tasks."lint:py"]
description = "Lint and format-check Python SDK code"
run = """
#!/usr/bin/env bash
set -euo pipefail
ruff check python/ python-providers/ python-frameworks/
ruff format --check python/ python-providers/ python-frameworks/
"""
[tasks."lint:cs"]
description = "Verify .NET SDK formatting and analyzer checks"
run = "dotnet format dotnet/Sigil.DotNet.sln --verify-no-changes"
[tasks.lint]
description = "Run all linting"
depends = ["lint:go", "lint:py", "lint:cs"]
# --- Type checking ---
[tasks."typecheck:ts:sdk-js"]
description = "Type-check TypeScript/JavaScript SDK code"
depends = ["deps"]
run = "pnpm --filter @grafana/sigil-sdk-js run typecheck"
[tasks.typecheck]
description = "Run all type checks"
depends = ["typecheck:ts:sdk-js"]
# --- Go SDK tests ---
[tasks."test:go:sdk-core"]
description = "Run Go SDK core tests as standalone module"
dir = "go"
run = "GOWORK=off go test ./..."
[tasks."test:go:sdk-anthropic"]
description = "Run Anthropic provider helper tests as standalone module"
dir = "go-providers/anthropic"
run = "GOWORK=off go test ./..."
[tasks."test:go:sdk-openai"]
description = "Run OpenAI provider helper tests as standalone module"
dir = "go-providers/openai"
run = "GOWORK=off go test ./..."
[tasks."test:go:sdk-gemini"]
description = "Run Gemini provider helper tests as standalone module"
dir = "go-providers/gemini"
run = "GOWORK=off go test ./..."
[tasks."test:go:sdk-google-adk"]
description = "Run Google ADK framework helper tests as standalone module"
dir = "go-frameworks/google-adk"
run = "GOWORK=off go test ./..."
[tasks."test:go:plugin-claude-code"]
description = "Run Claude Code plugin tests as standalone module"
dir = "plugins/claude-code"
run = "GOWORK=off go test ./..."
[tasks."test:go:sdk-conformance"]
description = "Run the Go SDK core conformance harness"
dir = "go"
run = "GOWORK=off go test ./sigil -run '^TestConformance' -count=1"
# --- TypeScript/JavaScript SDK tests ---
[tasks."test:ts:sdk-js"]
description = "Run TypeScript/JavaScript SDK runtime tests"
depends = ["deps"]
run = "pnpm --filter @grafana/sigil-sdk-js run test:ci"
[tasks."test:ts:sdk-conformance"]
description = "Run TypeScript/JavaScript SDK core conformance tests"
depends = ["deps"]
dir = "js"
run = "pnpm run test:build && node --test test/conformance.test.mjs"
[tasks."test:ts:sdk-provider-conformance"]
description = "Run TypeScript/JavaScript provider-wrapper conformance tests"
depends = ["deps"]
dir = "js"
run = "pnpm run test:build && node --test test/providers.test.mjs"
[tasks."test:ts:sdk-framework-conformance"]
description = "Run TypeScript/JavaScript framework-adapter conformance tests"
depends = ["deps"]
run = "mise run test:ts:sdk-js-frameworks"
[tasks."test:ts:sdk-js-frameworks"]
description = "Run TypeScript/JavaScript SDK framework handler tests"
depends = ["deps"]
dir = "js"
run = "pnpm run test:build && node --test test/frameworks.langchain.test.mjs test/frameworks.langgraph.test.mjs test/frameworks.additional.test.mjs test/frameworks.vercel-ai-sdk.mapping.test.mjs test/frameworks.vercel-ai-sdk.test.mjs"
# --- Python SDK tests ---
[tasks."test:py:sdk-core"]
description = "Run Python SDK core parity tests"
run = "uv run --python \"$PYTHON_BIN\" --with '.[dev]' --directory python pytest tests"
[tasks."test:py:sdk-conformance"]
description = "Run Python SDK core conformance tests"
run = "uv run --python \"$PYTHON_BIN\" --with '.[dev]' --directory python pytest tests/test_conformance.py"
[tasks."test:py:sdk-openai"]
description = "Run Python OpenAI provider helper tests"
run = "uv run --python \"$PYTHON_BIN\" --with './python[dev]' --with './python-providers/openai[dev]' pytest python-providers/openai/tests"
[tasks."test:py:sdk-anthropic"]
description = "Run Python Anthropic provider helper tests"
run = "uv run --python \"$PYTHON_BIN\" --with './python[dev]' --with './python-providers/anthropic[dev]' pytest python-providers/anthropic/tests"
[tasks."test:py:sdk-gemini"]
description = "Run Python Gemini provider helper tests"
run = "uv run --python \"$PYTHON_BIN\" --with './python[dev]' --with './python-providers/gemini[dev]' pytest python-providers/gemini/tests"
[tasks."test:py:sdk-langchain"]
description = "Run Python LangChain framework handler tests"
run = "uv run --python \"$PYTHON_BIN\" --with './python[dev]' --with './python-frameworks/langchain[dev]' pytest python-frameworks/langchain/tests"
[tasks."test:py:sdk-langgraph"]
description = "Run Python LangGraph framework handler tests"
run = "uv run --python \"$PYTHON_BIN\" --with './python[dev]' --with './python-frameworks/langgraph[dev]' pytest python-frameworks/langgraph/tests"
[tasks."test:py:sdk-openai-agents"]
description = "Run Python OpenAI Agents framework handler tests"
run = "uv run --python \"$PYTHON_BIN\" --with './python[dev]' --with './python-frameworks/openai-agents[dev]' pytest python-frameworks/openai-agents/tests"
[tasks."test:py:sdk-llamaindex"]
description = "Run Python LlamaIndex framework handler tests"
run = "uv run --python \"$PYTHON_BIN\" --with './python[dev]' --with './python-frameworks/llamaindex[dev]' pytest python-frameworks/llamaindex/tests"
[tasks."test:py:sdk-google-adk"]
description = "Run Python Google ADK framework handler tests"
run = "uv run --python \"$PYTHON_BIN\" --with './python[dev]' --with './python-frameworks/google-adk[dev]' pytest python-frameworks/google-adk/tests"
[tasks."test:py:sdk-litellm"]
description = "Run Python LiteLLM framework handler tests"
run = "uv run --python \"$PYTHON_BIN\" --with './python[dev]' --with './python-frameworks/litellm[dev]' pytest python-frameworks/litellm/tests"
[tasks."test:py:sdk-provider-conformance"]
description = "Run Python provider-wrapper conformance tests"
run = """
#!/usr/bin/env bash
set -euo pipefail
mise run test:py:sdk-openai
mise run test:py:sdk-anthropic
mise run test:py:sdk-gemini
"""
[tasks."test:py:sdk-framework-conformance"]
description = "Run Python framework-adapter conformance tests"
run = """
#!/usr/bin/env bash
set -euo pipefail
mise run test:py:sdk-langchain
mise run test:py:sdk-langgraph
mise run test:py:sdk-openai-agents
mise run test:py:sdk-llamaindex
mise run test:py:sdk-google-adk
mise run test:py:sdk-litellm
"""
# --- .NET SDK tests ---
[tasks."test:cs:sdk-core"]
description = "Run .NET SDK core runtime tests"
dir = "dotnet"
run = "dotnet test tests/Grafana.Sigil.Tests/Grafana.Sigil.Tests.csproj -c Release"
[tasks."test:cs:sdk-conformance"]
description = "Run .NET SDK core conformance tests"
dir = "dotnet"
run = "dotnet test tests/Grafana.Sigil.Tests/Grafana.Sigil.Tests.csproj -c Release --filter FullyQualifiedName~ConformanceTests"
[tasks."test:cs:sdk-openai"]
description = "Run .NET OpenAI provider helper tests"
dir = "dotnet"
run = "dotnet test tests/Grafana.Sigil.OpenAI.Tests/Grafana.Sigil.OpenAI.Tests.csproj -c Release"
[tasks."test:cs:sdk-anthropic"]
description = "Run .NET Anthropic provider helper tests"
dir = "dotnet"
run = "dotnet test tests/Grafana.Sigil.Anthropic.Tests/Grafana.Sigil.Anthropic.Tests.csproj -c Release"
[tasks."test:cs:sdk-gemini"]
description = "Run .NET Gemini provider helper tests"
dir = "dotnet"
run = "dotnet test tests/Grafana.Sigil.Gemini.Tests/Grafana.Sigil.Gemini.Tests.csproj -c Release"
[tasks."test:cs:sdk-provider-conformance"]
description = "Run .NET provider-wrapper conformance tests"
run = """
#!/usr/bin/env bash
set -euo pipefail
mise run test:cs:sdk-openai
mise run test:cs:sdk-anthropic
mise run test:cs:sdk-gemini
"""
# --- Java SDK tests ---
[tasks."test:java:sdk-core"]
description = "Run Java SDK core tests"
dir = "java"
run = "./gradlew --no-daemon :core:test"
[tasks."test:java:sdk-conformance"]
description = "Run Java SDK core conformance tests"
dir = "java"
run = "./gradlew --no-daemon :core:test --tests 'com.grafana.sigil.sdk.ConformanceTest'"
[tasks."test:java:sdk-openai"]
description = "Run Java OpenAI provider adapter tests"
dir = "java"
run = "./gradlew --no-daemon :providers:openai:test"
[tasks."test:java:sdk-anthropic"]
description = "Run Java Anthropic provider adapter tests"
dir = "java"
run = "./gradlew --no-daemon :providers:anthropic:test"
[tasks."test:java:sdk-gemini"]
description = "Run Java Gemini provider adapter tests"
dir = "java"
run = "./gradlew --no-daemon :providers:gemini:test"
[tasks."test:java:sdk-google-adk"]
description = "Run Java Google ADK framework adapter tests"
dir = "java"
run = "./gradlew --no-daemon :frameworks:google-adk:test"
[tasks."test:java:sdk-all"]
description = "Run all Java SDK tests"
dir = "java"
run = "./gradlew --no-daemon :core:test :providers:openai:test :providers:anthropic:test :providers:gemini:test :frameworks:google-adk:test"
[tasks."test:java:sdk-provider-conformance"]
description = "Run Java provider-wrapper conformance tests"
dir = "java"
run = "./gradlew --no-daemon :providers:openai:test :providers:anthropic:test :providers:gemini:test"
[tasks."test:java:sdk-framework-conformance"]
description = "Run Java framework-adapter conformance tests"
dir = "java"
run = "./gradlew --no-daemon :frameworks:google-adk:test"
[tasks."benchmark:java:sdk"]
description = "Run Java SDK JMH benchmarks"
dir = "java"
run = "./gradlew --no-daemon :benchmarks:jmh"
# --- Cross-SDK conformance ---
[tasks."test:sdk:core-conformance"]
description = "Run core conformance suites across Go, TypeScript/JavaScript, Python, Java, and .NET SDKs"
run = """
#!/usr/bin/env bash
set -euo pipefail
mise run test:go:sdk-conformance
mise run test:ts:sdk-conformance
mise run test:py:sdk-conformance
mise run test:java:sdk-conformance
mise run test:cs:sdk-conformance
"""
[tasks."test:sdk:provider-conformance"]
description = "Run provider-wrapper conformance suites across all shipped SDKs"
run = """
#!/usr/bin/env bash
set -euo pipefail
mise run test:go:sdk-anthropic
mise run test:go:sdk-openai
mise run test:go:sdk-gemini
mise run test:ts:sdk-provider-conformance
mise run test:py:sdk-provider-conformance
mise run test:cs:sdk-provider-conformance
mise run test:java:sdk-provider-conformance
"""
[tasks."test:sdk:framework-conformance"]
description = "Run framework-adapter conformance suites across all shipped SDKs"
run = """
#!/usr/bin/env bash
set -euo pipefail
mise run test:go:sdk-google-adk
mise run test:ts:sdk-framework-conformance
mise run test:py:sdk-framework-conformance
mise run test:java:sdk-framework-conformance
"""
[tasks."test:sdk:conformance"]
description = "Run core, provider-wrapper, and framework-adapter conformance suites across supported SDKs"
run = """
#!/usr/bin/env bash
set -euo pipefail
mise run test:sdk:core-conformance
mise run test:sdk:provider-conformance
mise run test:sdk:framework-conformance
"""
[tasks."test:sdk:all"]
description = "Run all SDK checks (Go, TypeScript/JavaScript, Python, Java, and .NET SDK suites)"
run = """
#!/usr/bin/env bash
set -euo pipefail
mise run test:go:sdk-core
mise run test:go:sdk-anthropic
mise run test:go:sdk-openai
mise run test:go:sdk-gemini
mise run test:go:sdk-google-adk
mise run test:go:plugin-claude-code
mise run test:ts:sdk-js
mise run test:py:sdk-core
mise run test:py:sdk-provider-conformance
mise run test:py:sdk-framework-conformance
mise run test:cs:sdk-core
mise run test:cs:sdk-provider-conformance
mise run test:java:sdk-all
"""
[tasks."sdk:conformance"]
description = "Alias for test:sdk:conformance"
run = "mise run test:sdk:conformance"
# --- Python version bump ---
[tasks."sdk:py:bump"]
description = "Bump version across all 9 Python SDK pyproject.toml files"
run = '''
#!/usr/bin/env bash
set -euo pipefail
VERSION="${1:?Usage: mise run sdk:py:bump <VERSION>}"
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: version must be in MAJOR.MINOR.PATCH format (got: $VERSION)" >&2
exit 1
fi
PACKAGE_DIRS=(
python
python-providers/openai
python-providers/anthropic
python-providers/gemini
python-frameworks/langchain
python-frameworks/langgraph
python-frameworks/openai-agents
python-frameworks/llamaindex
python-frameworks/google-adk
python-frameworks/litellm
)
for dir in "${PACKAGE_DIRS[@]}"; do
file="${dir}/pyproject.toml"
perl -i -pe "s/^version = \".*\"/version = \"${VERSION}\"/" "$file"
if [[ "$dir" != "python" ]]; then
perl -i -pe "s/\"sigil-sdk>=.*\"/\"sigil-sdk>=${VERSION}\"/" "$file"
fi
echo " updated ${file}"
done
echo "All Python SDK versions bumped to ${VERSION}"
'''
# --- Mock generation (stubs) ---
[tasks."generate:mocks:sdk-go"]
description = "Generate Go SDK mocks"
run = """
#!/usr/bin/env bash
set -euo pipefail
echo "==> generating Go SDK mocks"
echo "No Go SDK mocks to generate yet."
"""
[tasks."generate:mocks:sdk-go-providers"]
description = "Generate Go SDK provider mocks"
run = """
#!/usr/bin/env bash
set -euo pipefail
echo "==> generating Go SDK provider mocks"
echo "No Go SDK provider mocks to generate yet."
"""
[tasks."generate:mocks:sdk-go-frameworks"]
description = "Generate Go SDK framework mocks"
run = """
#!/usr/bin/env bash
set -euo pipefail
echo "==> generating Go SDK framework mocks"
echo "No Go SDK framework mocks to generate yet."
"""
[tasks."generate:mocks"]
description = "Generate all mock implementations"
depends = ["generate:mocks:sdk-go", "generate:mocks:sdk-go-providers", "generate:mocks:sdk-go-frameworks"]
[tasks.check]
description = "Run lint + typecheck + tests"
depends = ["lint", "typecheck"]
run = "mise run test:sdk:all"