-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
476 lines (411 loc) · 13.5 KB
/
pyproject.toml
File metadata and controls
476 lines (411 loc) · 13.5 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
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
[build-system]
requires = ["setuptools>=82.0.1"]
build-backend = "setuptools.build_meta"
[project]
name = "braintrust"
dynamic = ["version"]
description = "SDK for integrating Braintrust"
readme = "README.md"
license = "MIT"
requires-python = ">=3.10.0"
authors = [
{ name = "Braintrust", email = "sdk@braintrustdata.com" },
]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Operating System :: OS Independent",
]
dependencies = [
"GitPython>=3.1.50",
"requests",
"chevron",
"tqdm",
"exceptiongroup>=1.2.0",
"jsonschema",
"packaging",
"sseclient-py",
"python-slugify",
"typing_extensions>=4.1.0",
"wrapt",
]
[project.urls]
Homepage = "https://www.braintrust.dev"
"Source Code" = "https://github.com/braintrustdata/braintrust-sdk-python"
"Bug Tracker" = "https://github.com/braintrustdata/braintrust-sdk-python/issues"
[project.scripts]
braintrust = "braintrust.cli.__main__:main"
[project.entry-points.pytest11]
braintrust = "braintrust.wrappers.pytest_plugin.plugin"
[project.optional-dependencies]
cli = ["boto3", "python-dotenv", "uv", "starlette", "uvicorn"]
# TODO: remove the doc extra in the next major version.
doc = []
openai-agents = ["openai-agents"]
otel = [
"opentelemetry-api",
"opentelemetry-sdk",
"opentelemetry-exporter-otlp-proto-http",
]
performance = [
"orjson; platform_python_implementation != 'PyPy'",
]
# Deprecated: Temporal is now available via braintrust.auto_instrument();
# keep this extra as a compatibility alias until a future major release.
temporal = [
"temporalio>=1.19.0; python_version>='3.10'",
]
all = [
"boto3",
"openai-agents",
"opentelemetry-api",
"opentelemetry-exporter-otlp-proto-http",
"opentelemetry-sdk",
"orjson; platform_python_implementation != 'PyPy'",
"python-dotenv",
"starlette",
"temporalio>=1.19.0; python_version>='3.10'",
"uv",
"uvicorn",
]
[tool.setuptools.dynamic]
version = {attr = "braintrust.version.VERSION"}
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
braintrust = ["py.typed"]
# ---------------------------------------------------------------------------
# Dependency groups (PEP 735)
#
# Session auxiliary deps and infrastructure. These participate in
# ``uv lock`` and get a fully-resolved lockfile.
#
# Provider *matrix* versions live in ``[tool.braintrust.matrix]`` below
# because declaring every version combination as dependency-group conflicts
# creates ~1.5 M resolution forks and makes ``uv lock`` infeasible.
# ---------------------------------------------------------------------------
[dependency-groups]
# -- Base test deps (all sessions include this) --------------------------------
test = [
"pytest==9.0.3",
"pytest-asyncio==1.3.0",
"pytest-vcr==1.0.2",
]
# -- Session-specific auxiliary deps -------------------------------------------
test-openai-http2 = [
{include-group = "test"},
"h2==4.3.0",
]
test-openai-ddtrace = [
{include-group = "test"},
"ddtrace==4.1.0",
]
test-openai-agents = [
{include-group = "test"},
# openai is an auxiliary dep (matrix dep is openai-agents); pin here.
"openai==2.31.0",
]
test-litellm = [
{include-group = "test"},
# litellm requires openai<=1.99.9 (ResponseTextConfig removal in 1.100.0)
"openai==1.99.9",
"fastapi==0.135.3",
"orjson==3.11.8",
]
test-agno = [
{include-group = "test"},
"openai==2.31.0",
"fastapi==0.135.3",
]
test-agentscope = [
{include-group = "test"},
"openai==2.31.0",
]
test-strands = [
{include-group = "test"},
"openai==2.32.0",
]
test-pydantic-ai-logfire = [
{include-group = "test"},
"logfire==4.32.1",
]
test-langchain = [
{include-group = "test"},
"langchain-openai==1.1.14",
"langchain-anthropic==1.4.0",
"langgraph==1.1.6",
]
test-livekit-agents = [
{include-group = "test"},
"livekit-plugins-openai",
"livekit-plugins-silero",
# livekit-agents 1.3.x imports opentelemetry.sdk._logs.LogData, removed in newer SDKs.
# This is a LiveKit runtime compatibility constraint, not a Braintrust OTel integration dependency.
"opentelemetry-sdk<1.39",
]
test-crewai = [
{include-group = "test"},
# CrewAI's no-network smoke test forces the LiteLLM fallback path via
# ``is_litellm=True`` + ``mock_response``. Bumped to 1.83.14 so the
# transitive python-dotenv lands on 1.2.2 (CVE-2026-28684) instead of
# the 1.0.1 that older litellm hard-pins.
"litellm==1.83.14",
]
test-llamaindex = [
{include-group = "test"},
]
test-cli = [
{include-group = "test"},
"httpx==0.28.1",
]
test-types = [
{include-group = "test"},
"autoevals==0.2.0",
"pyright==1.1.408",
"mypy==1.20.0",
]
# -- Lint deps -----------------------------------------------------------------
lint = [
"pylint==4.0.5",
"pyperf==2.10.0",
# Packages below are needed so pylint can resolve every SDK import.
# Versions are unpinned (unless already constrained) so the resolver
# can find mutually compatible transitive deps.
"agentscope",
"agno",
"anthropic",
"autogen-agentchat",
"autogen-ext[openai]",
"claude-agent-sdk",
"cohere",
"autoevals",
"braintrust-core",
# crewai's transitive dep instructor pulls in pydantic-core 2.33.x, which
# does not yet ship wheels for Python 3.14. Exclude 3.14 so pylint can
# resolve the rest of the environment. Keep the package itself unpinned so
# the resolver can still pick a mutually compatible version with the other
# lint deps.
"crewai; python_version<'3.14'",
# onnxruntime 1.24.3 dropped cp310 wheels. Constrain the transitive
# resolution on Python 3.10 so pylint can still build its environment.
"onnxruntime<1.24; python_version<'3.11'",
"dspy",
"google-adk",
"google-genai",
"litellm>=1.83.10",
"livekit-agents",
"livekit-plugins-openai",
"mistralai",
"openai",
"openai-agents",
"openrouter",
"strands-agents",
"temporalio",
"pydantic-ai>=1.10.0",
"opentelemetry-instrumentation-openai==0.59.1",
"langsmith==0.8.0",
"langchain-core",
"langchain-openai",
"langchain-anthropic",
"llama-index-core",
"llama-index-llms-openai",
"llama-index-embeddings-openai",
]
# -- Build deps ----------------------------------------------------------------
build = [
"setuptools>=82.0.1",
]
# -- Dev deps (superset for local development) ---------------------------------
dev = [
{include-group = "test"},
{include-group = "build"},
"nox==2026.2.9",
"pre-commit==4.5.1",
"pylint==4.0.5",
"pyperf==2.10.0",
]
# ---------------------------------------------------------------------------
# UV conflicts — auxiliary session groups that pin different versions of the
# same package cannot coexist in a single resolution.
# ---------------------------------------------------------------------------
[tool.uv]
conflicts = [
# Groups that pin or transitively require conflicting openai versions.
[
{group = "test-openai-agents"},
{group = "test-litellm"},
{group = "test-crewai"},
{group = "test-agno"},
{group = "test-agentscope"},
{group = "test-strands"},
{group = "test-langchain"},
{group = "test-livekit-agents"},
{group = "lint"},
],
# opentelemetry-sdk version conflicts (google-adk/livekit vs logfire).
[
{group = "lint"},
{group = "test-pydantic-ai-logfire"},
{group = "test-livekit-agents"},
],
]
# ---------------------------------------------------------------------------
# Provider version matrix
#
# This is a custom metadata table — NOT dependency-groups — so it does not
# participate in ``uv lock`` (which would be infeasible with ~1.5 M conflict
# forks). The noxfile reads these at import time.
#
# Each key is a provider prefix. The value is a dict mapping human-readable
# version tags to the pip requirement string. "latest" is pinned to an
# explicit version and bumped by the weekly dependency-update workflow.
# ---------------------------------------------------------------------------
[tool.braintrust.matrix]
[tool.braintrust.matrix.openai]
latest = "openai==2.37.0"
"1.92.0" = "openai==1.92.0"
"1.77.0" = "openai==1.77.0"
"1.71.0" = "openai==1.71.0"
[tool.braintrust.matrix.anthropic]
latest = "anthropic==0.102.0"
"0.48.0" = "anthropic==0.48.0"
[tool.braintrust.matrix.cohere]
latest = "cohere==6.1.0"
"5.0.0" = "cohere==5.0.0"
[tool.braintrust.matrix.openai-agents]
latest = "openai-agents==0.17.2"
"0.13.6" = "openai-agents==0.13.6"
"0.0.19" = "openai-agents==0.0.19"
[tool.braintrust.matrix.litellm]
latest = "litellm==1.85.0"
"1.74.0" = "litellm==1.74.0"
[tool.braintrust.matrix.livekit-agents]
latest = "livekit-agents==1.5.10"
"1.3.1" = "livekit-agents==1.3.1"
[tool.braintrust.matrix.claude-agent-sdk]
latest = "claude-agent-sdk==0.2.82"
"0.1.10" = "claude-agent-sdk==0.1.10"
[tool.braintrust.matrix.agno]
latest = "agno==2.6.7"
"2.4.0" = "agno==2.4.0"
"2.1.0" = "agno==2.1.0"
[tool.braintrust.matrix.agentscope]
latest = "agentscope==1.0.20"
"1.0.0" = "agentscope==1.0.0"
[tool.braintrust.matrix.autogen-agentchat]
latest = "autogen-agentchat==0.7.5"
"0.7.0" = "autogen-agentchat==0.7.0"
[tool.braintrust.matrix.autogen-ext]
latest = "autogen-ext[openai]==0.7.5"
"0.7.0" = "autogen-ext[openai]==0.7.0"
[tool.braintrust.matrix.strands-agents]
latest = "strands-agents==1.40.0"
"1.20.0" = "strands-agents==1.20.0"
[tool.braintrust.matrix.pydantic-ai-integration]
latest = "pydantic-ai==1.97.0"
"1.10.0" = "pydantic-ai==1.10.0"
[tool.braintrust.matrix.pydantic-ai-wrap-openai]
latest = "pydantic-ai==1.97.0"
"1.0.1" = "pydantic-ai==1.0.1"
"0.1.9" = "pydantic-ai==0.1.9"
[tool.braintrust.matrix.autoevals]
latest = "autoevals==0.2.0"
"0.0.129" = "autoevals==0.0.129"
[tool.braintrust.matrix.google-genai]
latest = "google-genai==2.4.0"
"1.75.0" = "google-genai==1.75.0"
"1.30.0" = "google-genai==1.30.0"
[tool.braintrust.matrix.dspy]
latest = "dspy==3.2.1"
"2.6.0" = "dspy==2.6.0"
[tool.braintrust.matrix.crewai]
# 1.13.0 is the first release with the full causal-id surface (event_id /
# parent_event_id / started_event_id on BaseEvent) plus the ``usage`` field on
# LLMCallCompletedEvent that the Braintrust CrewAI integration depends on.
latest = "crewai==1.14.4"
"1.13.0" = "crewai==1.13.0"
[tool.braintrust.matrix.google-adk]
latest = "google-adk==1.33.0"
"1.14.1" = "google-adk==1.14.1"
[tool.braintrust.matrix.langchain-core]
latest = "langchain-core==1.4.0"
"0.3.28" = "langchain-core==0.3.28"
[tool.braintrust.matrix.llama-index-core]
latest = "llama-index-core==0.14.22"
"0.13.0" = "llama-index-core==0.13.0"
[tool.braintrust.matrix.openrouter]
latest = "openrouter==0.9.1"
"0.6.0" = "openrouter==0.6.0"
[tool.braintrust.matrix.mistralai]
latest = "mistralai==2.4.5"
"1.12.4" = "mistralai==1.12.4"
[tool.braintrust.matrix.temporalio]
latest = "temporalio==1.27.2"
"1.20.0" = "temporalio==1.20.0"
"1.19.0" = "temporalio==1.19.0"
[tool.braintrust.matrix.pytest-matrix]
# Canonical pytest pin. The matching entry in [dependency-groups].test is
# kept in sync by py/scripts/sync-pytest-pin.py (enforced by pre-commit).
latest = "pytest==9.0.3"
"8.4.2" = "pytest==8.4.2"
[tool.braintrust.matrix.braintrust-core]
latest = "braintrust-core==0.0.59"
# ---------------------------------------------------------------------------
# Vendor packages — optional third-party packages the SDK can work without.
# Keys are matrix keys; values are Python import names. The noxfile uses this
# table to:
# - pylint: install each at its matrix ``latest`` pin so import checks pass
# - test_core: verify none are importable in the minimal environment
# Packages that only need lint coverage but not test_core gating (e.g.
# pydantic-ai, langchain-core) belong in the ``lint`` dependency group instead.
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# Cassette directory mapping — maps integration directory names under
# ``src/braintrust/integrations/`` to the matrix key(s) whose version tags
# populate their ``cassettes/<version>/`` subdirectories.
#
# Used by ``scripts/check-stale-cassettes.py`` to detect orphaned cassette
# directories when versions are dropped from the matrix.
# ---------------------------------------------------------------------------
[tool.braintrust.cassette-dirs]
adk = ["google-adk"]
agentscope = ["agentscope"]
agno = ["agno"]
autogen = ["autogen-agentchat"]
anthropic = ["anthropic"]
cohere = ["cohere"]
claude_agent_sdk = ["claude-agent-sdk"]
crewai = ["crewai"]
dspy = ["dspy"]
google_genai = ["google-genai"]
langchain = ["langchain-core"]
litellm = ["litellm"]
livekit_agents = ["livekit-agents"]
llamaindex = ["llama-index-core"]
mistral = ["mistralai"]
openai = ["openai"]
openai_agents = ["openai-agents"]
openrouter = ["openrouter"]
pydantic_ai = ["pydantic-ai-integration", "pydantic-ai-wrap-openai"]
strands = ["strands-agents"]
[tool.braintrust.vendor-packages]
agno = "agno"
agentscope = "agentscope"
autogen-agentchat = "autogen_agentchat"
autogen-ext = "autogen_ext"
anthropic = "anthropic"
cohere = "cohere"
autoevals = "autoevals"
braintrust-core = "braintrust_core"
crewai = "crewai"
dspy = "dspy"
google-adk = "google.adk"
google-genai = "google.genai"
litellm = "litellm"
livekit-agents = "livekit.agents"
mistralai = "mistralai"
openai = "openai"
openai-agents = "agents"
openrouter = "openrouter"
strands-agents = "strands"
temporalio = "temporalio"