-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathtox.ini
More file actions
292 lines (248 loc) · 14.7 KB
/
Copy pathtox.ini
File metadata and controls
292 lines (248 loc) · 14.7 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
[tox]
requires =
tox-uv>=1
isolated_build = True
skipsdist = True
skip_missing_interpreters = True
envlist =
; Environments are organized by individual package, allowing
; for specifying supported Python versions per package.
; instrumentation-genai-openai
; oldest deps run only on the minimum supported Python: the lowest declared dependency versions
; predate newer interpreters and ship no wheels for them. latest covers the full interpreter range.
py3{10,11,12,13,14}-test-instrumentation-genai-openai-latest
py310-test-instrumentation-genai-openai-oldest
pypy3-test-instrumentation-genai-openai-latest
py314-test-instrumentation-genai-openai-conformance
lint-instrumentation-genai-openai
; instrumentation-genai-openai-agents
py3{10,11,12,13,14}-test-instrumentation-genai-openai_agents-latest
py310-test-instrumentation-genai-openai_agents-oldest
py314-test-instrumentation-genai-openai_agents-conformance
lint-instrumentation-genai-openai_agents
; instrumentation-google-genai
py3{10,11,12,13,14}-test-instrumentation-google-genai-latest
py310-test-instrumentation-google-genai-oldest
py3{12,13}-test-instrumentation-google-genai-conformance
# Disabling pypy3 as shapely does not have wheels and fails to compile
lint-instrumentation-google-genai
; instrumentation-genai-anthropic
py3{10,11,12,13,14}-test-instrumentation-genai-anthropic-latest
py310-test-instrumentation-genai-anthropic-oldest
# No pypy3: jiter (an anthropic dependency) ships no PyPy wheels, so it would need a Rust source build
py314-test-instrumentation-genai-anthropic-conformance
lint-instrumentation-genai-anthropic
; instrumentation-genai-claude-agent-sdk
py3{10,11,12,13}-test-instrumentation-genai-claude-agent-sdk-latest
py310-test-instrumentation-genai-claude-agent-sdk-oldest
# No pypy3: jiter (an anthropic dependency) ships no PyPy wheels, so it would need a Rust source build
lint-instrumentation-genai-claude-agent-sdk
; instrumentation-genai-langchain
py3{12,13}-test-instrumentation-genai-langchain-latest
py312-test-instrumentation-genai-langchain-oldest
py314-test-instrumentation-genai-langchain-conformance
lint-instrumentation-genai-langchain
; instrumentation-genai-weaviate-client
; TODO: write tests (tests/ is empty), add tests/requirements.{oldest,latest}.txt
; and weaviate-{oldest,latest} factors below.
lint-instrumentation-genai-weaviate-client
; opentelemetry-util-genai
py3{10,11,12,13,14}-test-util-genai
pypy3-test-util-genai
lint-util-genai
lint-license-header-check
spellcheck
docs
generate
shellcheck
precommit
typecheck
readme
[testenv]
test_deps =
opentelemetry-api
opentelemetry-semantic-conventions
opentelemetry-sdk
opentelemetry-instrumentation
opentelemetry-test-utils
pytest_deps =
; lower bounds so oldest envs (UV_RESOLUTION=lowest-direct) don't floor test tooling to ancient versions.
pytest>=8
pytest-asyncio>=0.24
pytest-vcr>=1.0.2
-e {toxinidir}/util/opentelemetry-test-util-genai
deps =
conformance: -r {toxinidir}/dev-requirements-conformance.txt
lint: -r dev-requirements.txt
coverage: pytest
coverage: pytest-cov
# packages that are released individually should provide a tests/requirements.{oldest,latest}.txt
# with the lowest version of OTel API and SDK supported (oldest) and the latest one.
openai-oldest: {[testenv]pytest_deps}
openai-oldest: -e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai[instruments]
openai-oldest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai/tests/requirements.oldest.txt
openai-latest: {[testenv]test_deps}
openai-latest: {[testenv]pytest_deps}
openai-latest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai/tests/requirements.latest.txt
openai-conformance: {[testenv]pytest_deps}
openai-conformance: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai/tests/requirements.latest.txt
openai_agents-oldest: {[testenv]pytest_deps}
openai_agents-oldest: -e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai-agents[instruments]
openai_agents-oldest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai-agents/tests/requirements.oldest.txt
openai_agents-latest: {[testenv]test_deps}
openai_agents-latest: {[testenv]pytest_deps}
openai_agents-latest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai-agents/tests/requirements.latest.txt
openai_agents-conformance: {[testenv]pytest_deps}
openai_agents-conformance: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai-agents/tests/requirements.latest.txt
google-genai-oldest: {[testenv]pytest_deps}
google-genai-oldest: -e {toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai[instruments]
google-genai-oldest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai/tests/requirements.oldest.txt
google-genai-latest: {[testenv]test_deps}
google-genai-latest: {[testenv]pytest_deps}
google-genai-latest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai/tests/requirements.latest.txt
google-genai-conformance: {[testenv]pytest_deps}
google-genai-conformance: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai/tests/requirements.latest.txt
anthropic-oldest: {[testenv]pytest_deps}
anthropic-oldest: -e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-anthropic[instruments]
anthropic-oldest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/requirements.oldest.txt
anthropic-latest: {[testenv]test_deps}
anthropic-latest: {[testenv]pytest_deps}
anthropic-latest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/requirements.latest.txt
anthropic-conformance: {[testenv]pytest_deps}
anthropic-conformance: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/requirements.latest.txt
claude-agent-sdk-oldest: {[testenv]pytest_deps}
claude-agent-sdk-oldest: -e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk[instruments]
claude-agent-sdk-oldest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk/tests/requirements.oldest.txt
claude-agent-sdk-latest: {[testenv]test_deps}
claude-agent-sdk-latest: {[testenv]pytest_deps}
claude-agent-sdk-latest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk/tests/requirements.latest.txt
; Langchain unit tests
langchain-{oldest,latest}: {[testenv]pytest_deps}
; oldest: declared deps (opentelemetry-instrumentation, util-genai, langchain) resolve from PyPI to
; their pyproject floors via UV_RESOLUTION=lowest-direct; only provider test libs are pinned by hand.
langchain-oldest: -e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-langchain[instruments]
langchain-oldest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-langchain/tests/requirements.oldest.txt
langchain-latest: {[testenv]test_deps}
langchain-latest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-langchain/tests/requirements.latest.txt
; Langchain conformance tests
langchain-conformance: {[testenv]pytest_deps}
langchain-conformance: -e {toxinidir}/util/opentelemetry-util-genai
langchain-conformance: -e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-langchain[instruments]
langchain-conformance: langchain-openai
langchain-conformance: langchain-aws
langchain-conformance: langchain-google-genai
langchain-conformance: boto3
util-genai: {[testenv]test_deps}
util-genai: {[testenv]pytest_deps}
util-genai: -r {toxinidir}/util/opentelemetry-util-genai/test-requirements.txt
util-genai: -e {toxinidir}/util/opentelemetry-util-genai
allowlist_externals =
sh
pytest
setenv =
UV_CONFIG_FILE={toxinidir}/tox-uv.toml
; oldest env installs the lowest versions of the package's direct declared deps straight from
; pyproject.toml, so the declared lower bounds are the single source of truth (no hand pins to drift).
; Only the instrumentation package under test is installed editable (`-e ...[instruments]`); its
; declared deps — including released ones like opentelemetry-util-genai — resolve from PyPI at their
; floors (with tox-uv.toml's no-sources), so the oldest env exercises the actual released versions.
oldest: UV_RESOLUTION=lowest-direct
commands_pre =
; In order to get a health coverage report,
; we have to install packages in editable mode.
coverage: python {toxinidir}/scripts/eachdist.py install --editable
commands =
test-instrumentation-genai-openai-{oldest,latest}: pytest --ignore={toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai/tests/test_conformance.py {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai/tests {posargs}
test-instrumentation-genai-openai-conformance: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai/tests/test_conformance.py --vcr-record=none {posargs}
lint-instrumentation-genai-openai: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-genai-openai"
test-instrumentation-genai-openai_agents-{oldest,latest}: pytest --ignore={toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai-agents/tests/test_conformance.py {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai-agents/tests {posargs}
test-instrumentation-genai-openai_agents-conformance: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai-agents/tests/test_conformance.py --vcr-record=none {posargs}
lint-instrumentation-genai-openai_agents: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-genai-openai-agents"
test-instrumentation-google-genai-{oldest,latest}: pytest --ignore={toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai/tests/test_conformance.py {toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai/tests --vcr-record=none {posargs}
test-instrumentation-google-genai-conformance: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai/tests/test_conformance.py --vcr-record=none {posargs}
lint-instrumentation-google-genai: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-google-genai"
test-instrumentation-genai-anthropic-{oldest,latest}: pytest --ignore={toxinidir}/instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_conformance.py {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-anthropic/tests --vcr-record=none {posargs}
test-instrumentation-genai-anthropic-conformance: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_conformance.py --vcr-record=none {posargs}
lint-instrumentation-genai-anthropic: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-genai-anthropic"
test-instrumentation-genai-claude-agent-sdk: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk/tests --vcr-record=none {posargs}
lint-instrumentation-genai-claude-agent-sdk: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-genai-claude-agent-sdk"
test-instrumentation-genai-langchain-{oldest,latest}: pytest --ignore={toxinidir}/instrumentation/opentelemetry-instrumentation-genai-langchain/tests/test_conformance.py {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-langchain/tests --vcr-record=none {posargs}
test-instrumentation-genai-langchain-conformance: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-langchain/tests/test_conformance.py --vcr-record=none {posargs}
lint-instrumentation-genai-langchain: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-genai-langchain"
lint-instrumentation-genai-weaviate-client: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-genai-weaviate-client"
test-util-genai: pytest {toxinidir}/util/opentelemetry-util-genai/tests {posargs}
lint-util-genai: sh -c "cd util && ruff check opentelemetry-util-genai"
coverage: {toxinidir}/scripts/coverage.sh
[testenv:docs]
deps =
-c {toxinidir}/dev-requirements.txt
-r {toxinidir}/docs-requirements.txt
pytest
{[testenv]test_deps}
{toxinidir}/util/opentelemetry-util-genai
changedir = docs
commands =
sphinx-build -E -a -W -b html -T . _build/html
[testenv:spellcheck]
basepython: python3
recreate = True
deps =
codespell==2.2.6
commands =
codespell
[testenv:generate]
commands =
python {toxinidir}/scripts/generate_instrumentation_readme.py
[testenv:readme]
description = Check each package README.rst renders on PyPI (matches twine check).
deps =
-c {toxinidir}/dev-requirements.txt
readme-renderer
allowlist_externals = sh
commands =
sh -c 'python {toxinidir}/scripts/check_for_valid_readme.py -v \
{toxinidir}/instrumentation/*/ \
{toxinidir}/util/opentelemetry-util-genai'
[testenv:lint-license-header-check]
commands =
python {toxinidir}/scripts/check_license_header.py
[testenv:changelog-preview]
description = Render a draft changelog for every package that uses towncrier.
deps =
towncrier==25.8.0
allowlist_externals = sh
commands =
sh -c '\
set -eu; \
for pkg in {toxinidir}/instrumentation/* {toxinidir}/util/opentelemetry-util-genai; do \
[ -f "$pkg/pyproject.toml" ] || continue; \
grep -q "tool.towncrier" "$pkg/pyproject.toml" || continue; \
echo "=== $pkg ==="; \
(cd "$pkg" && towncrier build --draft --version Unreleased); \
done'
[testenv:shellcheck]
commands_pre =
sh -c "sudo apt update -y && sudo apt install --assume-yes shellcheck"
commands =
sh -c "find {toxinidir} -name \*.sh | xargs shellcheck --severity=warning"
[testenv:{precommit,ruff}]
basepython: python3
deps =
-c {toxinidir}/dev-requirements.txt
pre-commit
commands =
pre-commit run --color=always --all-files {posargs}
[testenv:typecheck]
deps =
-c {toxinidir}/dev-requirements.txt
pyright
{[testenv]test_deps}
-e {toxinidir}/util/opentelemetry-util-genai[upload]
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai[instruments]
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-anthropic[instruments]
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-langchain[instruments]
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-claude-agent-sdk[instruments]
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-openai-agents[instruments]
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-genai-weaviate-client[instruments]
commands =
pyright