-
Notifications
You must be signed in to change notification settings - Fork 324
/
tox.ini
197 lines (180 loc) · 5.41 KB
/
tox.ini
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
[tox]
isolated_build = True
skipsdist = True
[testenv]
package = wheel
wheel_build_env = .pkg
[testenv:phoenix_evals]
description = Run tests for the arize-phoenix-evals package
changedir = packages/phoenix-evals/
deps =
-r requirements/ci.txt
commands_pre = uv pip install --strict --reinstall-package arize-phoenix-evals .[test]
commands =
uv pip list -v
mypy .
pytest -ra -x {posargs:.}
[testenv:phoenix_otel]
description = Run tests for the arize-phoenix-otel package
changedir = packages/phoenix-otel/
deps =
-r requirements/ci.txt
commands_pre = uv pip install --strict --reinstall-package arize-phoenix-otel .[test]
commands =
uv pip list -v
mypy .
; pytest -ra -x {posargs:.}
[testenv:type_check_integration_tests]
description = Run type checking with mypy on integration tests
changedir = tests/integration
deps =
-r requirements/integration-tests.txt
commands_pre =
uv pip install --strict --reinstall-package arize-phoenix ../../.
commands =
uv pip list -v
mypy {posargs:.}
[testenv:integration_tests]
description = Run integration tests
pass_env =
CI_TEST_DB_BACKEND
changedir = tests/integration
deps =
-r requirements/integration-tests.txt
commands_pre =
uv pip install --strict --reinstall-package arize-phoenix ../../.
commands =
uv pip list -v
pytest {posargs:.}
[testenv:type_check_unit_tests]
description = Run type checking with mypy on unit tests
changedir = tests/
deps =
-r requirements/unit-tests.txt
commands_pre =
uv pip install --strict --reinstall-package arize-phoenix ../.
commands =
uv pip list -v
mypy {posargs:.}
[testenv:unit_tests]
description = Run unit tests
changedir = tests
deps =
-r requirements/unit-tests.txt
commands_pre =
uv pip install --strict --reinstall-package arize-phoenix ../.
commands =
uv pip list -v
pytest --ignore=integration {posargs:.}
[testenv:unit_tests_local_evals]
description = Run unit tests with phoenix-evals installed from local source
changedir = tests
deps =
-r requirements/unit-tests.txt
commands_pre =
uv pip install --strict --reinstall-package arize-phoenix --reinstall-package arize-phoenix-evals ../. arize-phoenix-evals@../packages/phoenix-evals
commands =
uv pip list -v
pytest --ignore=integration {posargs:.}
[testenv:type_check]
description = Run type checking with mypy on src/phoenix
deps =
-r requirements/type-check.txt
commands_pre =
uv pip install --strict --reinstall-package arize-phoenix .
commands =
uv pip list -v
mypy {posargs:src/phoenix}
[testenv:clean_jupyter_notebooks]
description = Clear output and metadata from Jupyter notebooks
deps =
-r requirements/clean-jupyter-notebooks.txt
commands =
uv pip list -v
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True --inplace {posargs}
[testenv:build_graphql_schema]
description = Export GraphQL schema to a file (Python 3.9)
basepython = python3.9
changedir = app
deps =
-r requirements/build-graphql-schema.txt
commands_pre =
uv pip install --strict --reinstall-package arize-phoenix ../.
commands =
uv pip list -v
strawberry export-schema phoenix.server.api.schema:_EXPORTED_GRAPHQL_SCHEMA -o schema.graphql
[testenv:build_openapi_schema]
description = Export OpenAPI schema to a file (Python 3.9)
basepython = python3.9
changedir = schemas
commands_pre =
uv pip install --strict --reinstall-package arize-phoenix ../.
commands =
uv pip list -v
python -m phoenix.server.api.openapi.main -o openapi.json
[testenv:compile_protobuf]
description = Compile protobuf files (Python 3.9)
basepython = python3.9
deps =
-r requirements/compile-protobuf.txt
commands =
uv pip list -v
python -m grpc_tools.protoc -I src/phoenix/proto --python_out=src/phoenix --mypy_out=src/phoenix src/phoenix/proto/trace/v1/evaluation.proto
[testenv:add_symlinks]
description = Add symlinks to packages (for editable install)
changedir = src/phoenix
allowlist_externals =
sh
commands =
sh -c '[ -e evals ] || ln -s ../../packages/phoenix-evals/src/phoenix/evals evals'
sh -c '[ -e otel ] || ln -s ../../packages/phoenix-otel/src/phoenix/otel otel'
[testenv:remove_symlinks]
description = Remove symlinks to packages
changedir = src/phoenix
allowlist_externals =
unlink
commands =
unlink evals
unlink otel
[testenv:phoenix_main]
description = Run Phoenix server
pass_env=
PHOENIX_PORT
PHOENIX_GRPC_PORT
PHOENIX_HOST_ROOT_PATH
PHOENIX_SQL_DATABASE_URL
PHOENIX_SQL_DATABASE_SCHEMA
PHOENIX_ENABLE_AUTH
PHOENIX_SECRET
PHOENIX_OAUTH2_GOOGLE_CLIENT_ID
PHOENIX_OAUTH2_GOOGLE_CLIENT_SECRET
PHOENIX_OAUTH2_GOOGLE_OIDC_CONFIG_URL
PHOENIX_OAUTH_GITHUB_CLIENT_ID
PHOENIX_OAUTH_GITHUB_CLIENT_SECRET
PHOENIX_OAUTH2_AUTH0_CLIENT_ID
PHOENIX_OAUTH2_AUTH0_CLIENT_SECRET
PHOENIX_OAUTH2_AUTH0_OIDC_CONFIG_URL
PHOENIX_OAUTH2_AZURE_AD_OIDC_CONFIG_URL
PHOENIX_OAUTH2_AZURE_AD_CLIENT_ID
PHOENIX_OAUTH2_AZURE_AD_CLIENT_SECRET
PHOENIX_OAUTH2_AWS_COGNITO_CLIENT_ID
PHOENIX_OAUTH2_AWS_COGNITO_CLIENT_SECRET
PHOENIX_OAUTH2_AWS_COGNITO_OIDC_CONFIG_URL
PHOENIX_SMTP_HOSTNAME
PHOENIX_SMTP_PORT
PHOENIX_SMTP_USERNAME
PHOENIX_SMTP_PASSWORD
commands_pre =
uv tool install arize-phoenix@. \
--reinstall-package arize-phoenix \
--with-requirements requirements/dev.txt \
--compile-bytecode
commands =
uv tool run arize-phoenix {posargs:serve}
[testenv:ruff]
description = Run ruff for formatting and linting
commands_pre =
uv tool install [email protected]
commands =
uv tool run ruff format
uv tool run ruff check --fix