forked from Arize-ai/phoenix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
165 lines (155 loc) · 6.49 KB
/
Copy pathtox.ini
File metadata and controls
165 lines (155 loc) · 6.49 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
[tox]
isolated_build = True
skipsdist = True
[testenv]
package = wheel
wheel_build_env = .pkg
allowlist_externals =
uv
[testenv:phoenix_client]
description = Run tests for the arize-phoenix-client package
changedir = packages/phoenix-client/
commands_pre =
uv pip install --strict -U -r {toxinidir}/requirements/packages/phoenix-client.txt
uv pip install --strict --reinstall-package arize-phoenix-evals {toxinidir}/packages/phoenix-evals
uv pip install --strict --reinstall-package arize-phoenix-client .
commands =
uv pip list -v
{envbindir}/pyright .
{envbindir}/mypy --strict .
{envbindir}/pytest {posargs} tests/client
[testenv:phoenix_client_canary_tests_sdk_openai]
description = Run phoenix-client canary tests for third-party SDK: anthropic
changedir = packages/phoenix-client/
setenv =
SDK = openai
MOD = chat
TESTS = tests/canary/sdk
HELPERS = src/phoenix/client/helpers/sdk
SDK_TESTS = {env:TESTS}/{env:SDK}
SDK_HELPERS = {env:HELPERS}/{env:SDK}
REQ = {toxinidir}/requirements
SDK_REQ = {env:REQ}/canary/sdk/{env:SDK}.txt
commands_pre =
uv pip install --strict -U --reinstall-package arize-phoenix-client .
uv pip uninstall -r {toxinidir}/requirements/canary/sdk/{env:SDK}.txt
uv pip list -v
commands =
python -c "import phoenix.client.helpers.sdk.{env:SDK}.{env:MOD}"
uv pip install --strict -U -r {env:REQ}/ci.txt
uv pip install --strict -U -r {env:SDK_REQ}
uv pip list -v
pyright -p {env:HELPERS}/pyrightconfig.json {env:SDK_HELPERS}
pyright -p {env:TESTS}/pyrightconfig.json {env:SDK_TESTS}
mypy --strict --follow-untyped-imports {env:SDK_HELPERS}/{env:MOD}.py
mypy --strict --follow-untyped-imports {env:SDK_TESTS}/test_{env:MOD}.py
pytest --disable-socket {posargs} {env:SDK_TESTS}
[testenv:phoenix_client_canary_tests_sdk_anthropic]
description = Run phoenix-client canary tests for third-party SDK: anthropic
changedir = packages/phoenix-client/
setenv =
SDK = anthropic
MOD = messages
TESTS = tests/canary/sdk
HELPERS = src/phoenix/client/helpers/sdk
SDK_TESTS = {env:TESTS}/{env:SDK}
SDK_HELPERS = {env:HELPERS}/{env:SDK}
REQ = {toxinidir}/requirements
SDK_REQ = {env:REQ}/canary/sdk/{env:SDK}.txt
commands_pre =
uv pip install --strict -U --reinstall-package arize-phoenix-client .
uv pip uninstall -r {toxinidir}/requirements/canary/sdk/{env:SDK}.txt
uv pip list -v
commands =
python -c "import phoenix.client.helpers.sdk.{env:SDK}.{env:MOD}"
uv pip install --strict -U -r {env:REQ}/ci.txt
uv pip install --strict -U -r {env:SDK_REQ}
uv pip list -v
pyright -p {env:HELPERS}/pyrightconfig.json {env:SDK_HELPERS}
pyright -p {env:TESTS}/pyrightconfig.json {env:SDK_TESTS}
mypy --strict --follow-untyped-imports {env:SDK_HELPERS}/{env:MOD}.py
mypy --strict --follow-untyped-imports {env:SDK_TESTS}/test_{env:MOD}.py
pytest --disable-socket {posargs} {env:SDK_TESTS}
[testenv:phoenix_client_canary_tests_sdk_google_generativeai]
description = Run phoenix-client canary tests for third-party SDK: google_generativeai
changedir = packages/phoenix-client/
setenv =
SDK = google_generativeai
MOD = generate_content
TESTS = tests/canary/sdk
HELPERS = src/phoenix/client/helpers/sdk
SDK_TESTS = {env:TESTS}/{env:SDK}
SDK_HELPERS = {env:HELPERS}/{env:SDK}
REQ = {toxinidir}/requirements
SDK_REQ = {env:REQ}/canary/sdk/{env:SDK}.txt
commands_pre =
uv pip install --strict -U --reinstall-package arize-phoenix-client .
uv pip uninstall -r {toxinidir}/requirements/canary/sdk/{env:SDK}.txt
uv pip list -v
commands =
python -c "import phoenix.client.helpers.sdk.{env:SDK}.{env:MOD}"
uv pip install --strict -U -r {env:REQ}/ci.txt
uv pip install --strict -U -r {env:SDK_REQ}
uv pip list -v
pyright -p {env:HELPERS}/pyrightconfig.json {env:SDK_HELPERS}
pyright -p {env:TESTS}/pyrightconfig.json {env:SDK_TESTS}
mypy --strict --follow-untyped-imports {env:SDK_HELPERS}/{env:MOD}.py
mypy --strict --follow-untyped-imports {env:SDK_TESTS}/test_{env:MOD}.py
pytest --disable-socket {posargs} {env:SDK_TESTS}
[testenv:phoenix_evals]
description = Run tests for the arize-phoenix-evals package
changedir = packages/phoenix-evals/
commands_pre =
uv pip install --strict -U -r {toxinidir}/requirements/packages/phoenix-evals.txt
uv pip install --strict --reinstall-package arize-phoenix-evals .[test]
commands =
uv pip list -v
mypy .
pytest {posargs} .
[testenv:phoenix_otel]
description = Run tests for the arize-phoenix-otel package
changedir = packages/phoenix-otel/
commands_pre =
uv pip install --strict -U -r {toxinidir}/requirements/ci.txt
uv pip install --strict --reinstall-package arize-phoenix-otel .[test]
commands =
uv pip list -v
mypy .
pytest -ra {posargs:.}
[testenv:integration_tests]
description = Run integration tests
pass_env =
CI_TEST_DB_BACKEND
changedir = tests/integration
setenv =
PHOENIX_MASK_INTERNAL_SERVER_ERRORS = false
commands_pre =
uv pip install --strict -U -r {toxinidir}/requirements/integration-tests.txt
uv pip install --strict --reinstall-package arize-phoenix-evals {toxinidir}/packages/phoenix-evals
uv pip install --no-sources --strict --reinstall-package arize-phoenix {toxinidir}
python -c "import sysconfig, re, pathlib; vf=pathlib.Path(sysconfig.get_path('purelib'))/'phoenix'/'version.py'; m=re.search(r'\"(\d+)\.',vf.read_text()); vf.write_text(f'__version__ = \"{int(m.group(1))+1}.0.0\"\n')" # Return the next major version in response headers so all client methods work; otherwise, some may be version-gated. Avoids importing phoenix (which triggers heavy deps like pandas/numpy).
uv pip install --strict --reinstall-package arize-phoenix-client {toxinidir}/packages/phoenix-client
commands =
uv pip list -v
pytest {posargs} .
[testenv:unit_tests]
description = Run unit tests
changedir = tests
setenv =
PHOENIX_MASK_INTERNAL_SERVER_ERRORS = false
commands_pre =
uv pip install --strict -U -r {toxinidir}/requirements/unit-tests.txt
uv pip install --strict --reinstall-package arize-phoenix-evals {toxinidir}/packages/phoenix-evals
uv pip install --no-sources --strict --reinstall-package arize-phoenix {toxinidir}
commands =
uv pip list -v
pytest {posargs} unit/
[testenv:unit_tests_local_evals]
description = Run unit tests with phoenix-evals installed from local source
changedir = tests
commands_pre =
uv pip install --strict -U -r {toxinidir}/requirements/unit-tests.txt
uv pip install --no-sources --strict --reinstall-package arize-phoenix --reinstall-package arize-phoenix-evals ../. arize-phoenix-evals@../packages/phoenix-evals
commands =
uv pip list -v
pytest {posargs} unit/