-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtox.ini
More file actions
223 lines (180 loc) · 8.92 KB
/
tox.ini
File metadata and controls
223 lines (180 loc) · 8.92 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
[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-openai
py3{10,11,12,13,14}-test-instrumentation-openai-v2-{oldest,latest}
pypy3-test-instrumentation-openai-v2-{oldest,latest}
lint-instrumentation-openai-v2
; instrumentation-openai-agents
py3{10,11,12,13,14}-test-instrumentation-openai_agents-v2-{oldest,latest}
lint-instrumentation-openai_agents-v2
; instrumentation-google-genai
py3{10,11,12,13,14}-test-instrumentation-google-genai-{oldest,latest}
# Disabling pypy3 as shapely does not have wheels and fails to compile
lint-instrumentation-google-genai
; instrumentation-anthropic
py3{10,11,12,13,14}-test-instrumentation-anthropic-{oldest,latest}
# Disabling pypy3 as jiter (anthropic dep) requires PyPy 3.11+
lint-instrumentation-anthropic
; instrumentation-claude-agent-sdk
py3{10,11,12,13}-test-instrumentation-claude-agent-sdk-{oldest,latest}
# Disabling pypy3 as jiter (anthropic dep) requires PyPy 3.11+
lint-instrumentation-claude-agent-sdk
; instrumentation-langchain
; TODO: add tests/requirements.{oldest,latest}.txt and langchain-{oldest,latest}
; factors below; declare opentelemetry-util-genai in the package pyproject.toml
; (latent bug — code imports it but it's not in runtime deps).
lint-instrumentation-langchain
; instrumentation-weaviate
; TODO: write tests (tests/ is empty), add tests/requirements.{oldest,latest}.txt
; and weaviate-{oldest,latest} factors below.
lint-instrumentation-weaviate
; 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
generate-workflows
shellcheck
precommit
typecheck
[testenv]
test_deps =
opentelemetry-api
opentelemetry-semantic-conventions
opentelemetry-sdk
opentelemetry-instrumentation
opentelemetry-test-utils
pytest_deps =
pytest
pytest-asyncio
pytest-vcr
-e {toxinidir}/util/opentelemetry-test-util-genai
deps =
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: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-openai-v2/tests/requirements.oldest.txt
openai-oldest: {[testenv]pytest_deps}
openai-latest: {[testenv]test_deps}
openai-latest: {[testenv]pytest_deps}
openai-latest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-openai-v2/tests/requirements.latest.txt
lint-instrumentation-openai-v2: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-openai-v2/tests/requirements.oldest.txt
openai_agents-oldest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-openai-agents-v2/tests/requirements.oldest.txt
openai_agents-oldest: {[testenv]pytest_deps}
openai_agents-latest: {[testenv]test_deps}
openai_agents-latest: {[testenv]pytest_deps}
openai_agents-latest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-openai-agents-v2/tests/requirements.latest.txt
lint-instrumentation-openai_agents-v2: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-openai-agents-v2/tests/requirements.oldest.txt
google-genai-oldest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai/tests/requirements.oldest.txt
google-genai-oldest: {[testenv]pytest_deps}
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
lint-instrumentation-google-genai: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai/tests/requirements.oldest.txt
anthropic-oldest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-anthropic/tests/requirements.oldest.txt
anthropic-oldest: {[testenv]pytest_deps}
anthropic-latest: {[testenv]test_deps}
anthropic-latest: {[testenv]pytest_deps}
anthropic-latest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-anthropic/tests/requirements.latest.txt
lint-instrumentation-anthropic: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-anthropic/tests/requirements.oldest.txt
claude-agent-sdk-oldest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-claude-agent-sdk/tests/requirements.oldest.txt
claude-agent-sdk-oldest: {[testenv]pytest_deps}
claude-agent-sdk-latest: {[testenv]test_deps}
claude-agent-sdk-latest: {[testenv]pytest_deps}
claude-agent-sdk-latest: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-claude-agent-sdk/tests/requirements.latest.txt
lint-instrumentation-claude-agent-sdk: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-claude-agent-sdk/tests/requirements.oldest.txt
util-genai: {[testenv]test_deps}
util-genai: {[testenv]pytest_deps}
util-genai: -r {toxinidir}/util/opentelemetry-util-genai/test-requirements.txt
util-genai: {toxinidir}/util/opentelemetry-util-genai
allowlist_externals =
sh
pytest
setenv =
UV_CONFIG_FILE={toxinidir}/tox-uv.toml
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-openai-v2: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-openai-v2/tests {posargs}
lint-instrumentation-openai-v2: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-openai-v2"
test-instrumentation-openai_agents-v2: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-openai-agents-v2/tests {posargs}
lint-instrumentation-openai_agents-v2: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-openai-agents-v2"
test-instrumentation-google-genai: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai/tests --vcr-record=none {posargs}
lint-instrumentation-google-genai: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-google-genai"
test-instrumentation-anthropic: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-anthropic/tests --vcr-record=none {posargs}
lint-instrumentation-anthropic: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-anthropic"
test-instrumentation-claude-agent-sdk: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-claude-agent-sdk/tests --vcr-record=none {posargs}
lint-instrumentation-claude-agent-sdk: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-claude-agent-sdk"
lint-instrumentation-langchain: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-langchain"
lint-instrumentation-weaviate: sh -c "cd instrumentation && ruff check opentelemetry-instrumentation-weaviate"
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:lint-license-header-check]
commands =
python {toxinidir}/scripts/check_license_header.py
[testenv:generate-workflows]
recreate = True
deps =
{toxinidir}/.github/workflows/generate_workflows_lib
commands =
python {toxinidir}/.github/workflows/generate_workflows.py
[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}
{toxinidir}/util/opentelemetry-util-genai[upload]
{toxinidir}/instrumentation/opentelemetry-instrumentation-google-genai[instruments]
{toxinidir}/instrumentation/opentelemetry-instrumentation-anthropic[instruments]
{toxinidir}/instrumentation/opentelemetry-instrumentation-langchain[instruments]
{toxinidir}/instrumentation/opentelemetry-instrumentation-claude-agent-sdk[instruments]
{toxinidir}/instrumentation/opentelemetry-instrumentation-weaviate[instruments]
commands =
pyright