-
Notifications
You must be signed in to change notification settings - Fork 299
/
tox.ini
174 lines (157 loc) · 4.65 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
[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
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
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
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
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