-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathpyproject.toml
More file actions
297 lines (271 loc) * 9.71 KB
/
pyproject.toml
File metadata and controls
297 lines (271 loc) * 9.71 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
293
294
295
296
297
[project]
name = "arize"
description = "A helper library to interact with Arize AI APIs"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "Apache-2.0" }
license-files = ["LICENSE", "NOTICE"]
keywords = [
"Arize",
"Observability",
"Monitoring",
"Explainability",
"Tracing",
"LLM",
"Evaluations",
]
authors = [{ name = "Arize AI", email = "support@arize.com" }]
maintainers = [{ name = "Arize AI", email = "support@arize.com" }]
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Logging",
"Topic :: System :: Monitoring",
]
dependencies = [
"numpy>=2.0.0",
"openinference-semantic-conventions>=0.1.25, <1",
"opentelemetry-exporter-otlp-proto-common>=1.38.0",
"opentelemetry-exporter-otlp-proto-grpc>=1.38.0",
"opentelemetry-sdk>=1.38.0",
"opentelemetry-semantic-conventions>=0.43b0, <1",
"pandas>=2.0.0, <3",
"protobuf>=4.21.0, <7",
"pyarrow>=0.15.0",
"pydantic>=2, <3",
"python-dateutil>=2.8.2, <3",
"requests>=2.0.0, <3",
"requests_futures>=1.0.0, <2",
"tqdm>4, <5", # For progress bars
"typing-extensions>=4.7.1, <5",
"urllib3>=2.1.0, <3",
"wrapt>=1.0.0, <2.0.0",
]
dynamic = ["version"]
[project.optional-dependencies]
dev = [
"mypy==1.19.1",
"pandas-stubs>=2.2.0",
"pytest-cov==6.0.0",
"pytest==8.4.2",
"ruff==0.14.9",
"taskipy>=1.14.1, <2",
"types-python-dateutil>=2.9.0",
"types-requests>=2.31.0",
"types-tabulate>=0.9.0",
"types-tqdm>=4.66.0",
]
otel = [
"arize-otel>=0.11.0, <1",
]
mimic = [
"interpret-community[mimic]>=0.22.0,<1",
]
embeddings = [
"Pillow>=8.4.0, <11",
"datasets>=2.8, <3, !=2.14.*",
"tokenizers>=0.13, <1",
"torch>=1.13, <3",
"transformers>=4.25, <5",
]
docs = [
"sphinx>=7.0.0, <8.0.0",
"sphinx-autobuild>=2024.0.0",
"pydata-sphinx-theme>=0.15.0",
"sphinx-copybutton>=0.5.0",
"sphinx-design>=0.5.0",
"myst-parser>=2.0.0",
]
[project.urls]
Homepage = "https://arize.com"
Documentation = "https://docs.arize.com/arize"
Issues = "https://github.com/Arize-ai/client_python/issues"
Source = "https://github.com/Arize-ai/client_python"
Changelog = "https://github.com/Arize-ai/client_python/blob/main/CHANGELOG.md"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/arize/version.py"
[tool.hatch.build]
only-packages = true
[tool.hatch.build.targets.wheel]
packages = ["src/arize"]
[tool.hatch.build.targets.sdist]
exclude = ["tests", "docs"]
[tool.black]
include = '\.pyi?$'
exclude = '(_pb2\.py$|docs/source/.*\.py)'
[tool.ruff]
target-version = "py310"
line-length = 80
exclude = [
"dist/",
"testing_notebooks/",
"__pycache__",
"src/arize/_generated/**/*.py",
"*_pb2.py*",
"*_pb2_grpc.py*",
"*.pyi",
"docs/",
]
[tool.ruff.format]
docstring-code-format = true
line-ending = "native"
[tool.ruff.lint]
select = [
# Core correctness & style
# ------------------------
"E", # pycodestyle errors (syntax, indentation, whitespace)
"W", # pycodestyle warnings (less severe style issues)
"F", # Pyflakes (unused imports, undefined names, etc.)
"UP", # pyupgrade (modernize syntax for your Python version)
"B", # flake8-bugbear (likely bugs and design problems)
"SIM", # flake8-simplify (simpler / clearer code patterns)
"I", # isort (import ordering)
# Typing & documentation
# ------------------------
"ANN", # flake8-annotations (enforce type annotations)
"D", # pydocstyle (docstring conventions for public APIs)
"TCH", # flake8-type-checking (TYPE_CHECKING import hygiene)
# Recommended for SDKs
# ------------------------
"RUF", # Ruff-native rules (high-signal correctness & footguns)
"C4", # flake8-comprehensions (cleaner comprehensions)
"PIE", # flake8-pie (small correctness & readability improvements)
"PERF", # perflint (common performance pitfalls)
"DTZ", # flake8-datetimez (timezone-aware datetime usage)
"TRY", # tryceratops (better exception handling patterns)
"RET", # flake8-return (return consistency)
"S", # flake8-bandit (basic security issues; tune via ignores)
]
ignore = [
"TRY003", # Put long / detailed messages inside the exception class
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"D104", # Missing docstring in public package
"DTZ001", # Allow naive datetime usage in tests
"S101", # Allow assert statements in tests
"S108", # Allow insecure usage of temporary file or directory
"TRY301", # Allow generic exception catching in tests
"B017", # Allow blind asserting exception: `Exception`
]
[tool.ruff.lint.isort]
force-wrap-aliases = true
[tool.ruff.lint.pycodestyle]
max-doc-length = 110
max-line-length = 110
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.mypy]
python_version = "3.10"
warn_unused_configs = true
exclude = ["testing_notebooks/", "src/arize/_generated/", "tests/"]
# Incrementally enable strict type checking by uncommenting checks from bottom to top.
# Fix foundational issues (imports, syntax) before type definitions, then signatures, then implementations.
disable_error_code = []
# Ignore missing imports for libraries without type stubs
[[tool.mypy.overrides]]
module = [
"pyarrow.*",
"google.protobuf.*",
"wrapt.*",
"datasets.*",
"requests_futures.*",
"interpret_community.*",
"sklearn.*",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
# Directory where pytest will search for tests
testpaths = ["tests"]
# Patterns for discovering test files (files matching these patterns will be collected)
python_files = ["test_*.py", "*_test.py"]
# Patterns for discovering test classes (classes matching this pattern will be collected)
python_classes = ["Test*"]
# Patterns for discovering test functions (functions matching this pattern will be collected)
python_functions = ["test_*"]
# Directories and patterns to ignore during test collection
norecursedirs = [
"testing_notebooks",
".*",
"build",
"dist",
"*.egg"
]
# Additional command-line options to always apply when running pytest
addopts = [
"-v", # Verbose: show individual test names as they run
"--strict-markers", # Error on undefined markers (prevents typos like @pytest.mark.slo instead of @pytest.mark.slow)
"--tb=short", # Shorter tracebacks: show only the failure point without full stack
"--durations=10", # Show the 10 slowest tests at the end (helps identify performance bottlenecks)
]
# Custom markers that can be used to categorize tests (use with @pytest.mark.marker_name)
markers = [
"unit: marks tests as unit tests (fast, isolated, uses mocks)",
"integration: marks tests as integration tests",
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
[tool.coverage.run]
source = ["src/arize"]
omit = [
"*/tests/*",
"*/testing_notebooks/*",
"*/_generated/*",
"*/__pycache__/*",
"*/site-packages/*",
"src/arize/constants/*", # We don't need to test constants, they are just definitions
"src/arize/exceptions/*", # We don't need to test exceptions, they are just definitions
# Exclude other src/arize modules. TODO(Kiko): Remove them progressively.
"src/arize/datasets/*",
"src/arize/experiments/*",
"src/arize/ml/*",
"src/arize/projects/*",
"src/arize/spans/*",
]
# Enable branch coverage (measures whether all branches of if/else/try/except are tested)
# Without this, only line coverage is measured
branch = true
[tool.coverage.report]
# Number of decimal places to show in coverage percentages (e.g., 85.47% instead of 85%)
precision = 2
# Show line numbers for lines that are missing coverage in the report
show_missing = true
# If true, files with 100% coverage would be hidden from the report
skip_covered = false
# Minimum coverage percentage required (build fails if total coverage is below this)
fail_under = 90
# Lines matching these patterns are excluded from coverage measurement
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
"@abc.abstractmethod",
]
[tool.coverage.html]
# Directory where HTML coverage reports will be generated (browsable in a web browser)
directory = "htmlcov"
[tool.taskipy.tasks]
lint = { cmd = "ruff format . && ruff check --fix .", cwd = ".", help = "Run ruff to format and lint the package." }
type-check = {cmd = "mypy --no-incremental --show-traceback --config-file pyproject.toml .", cwd = ".", help = "Run mypy for type checking."}
test = {cmd = "pytest --cov .", cwd = ".", help = "Run the test suite with coverage."}
# Exclusive for CI
ci-format = { cmd = "ruff format --check .", cwd = ".", help = "Run ruff to check formatting of the package during CI." }
ci-lint = { cmd = "ruff check .", cwd = ".", help = "Run ruff to check linting rules of the package during CI." }
ci-type-check = {cmd = "mypy --no-incremental --show-traceback --config-file pyproject.toml .", cwd = ".", help = "Run mypy for type checking during CI."}
ci-test = {cmd = "pytest --cov --cov-report=term-missing --cov-report=html .", cwd = ".", help = "Run the test suite with coverage during CI."}