-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
220 lines (198 loc) · 6.76 KB
/
pyproject.toml
File metadata and controls
220 lines (198 loc) · 6.76 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
# SPDX-FileCopyrightText: 2026 The Botanu Authors
# SPDX-License-Identifier: Apache-2.0
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
# ---------------------------------------------------------------------------
# Project metadata (PEP 621)
# ---------------------------------------------------------------------------
[project]
name = "botanu"
dynamic = ["version"]
description = "OpenTelemetry-native run-level cost attribution for AI workflows"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.9"
authors = [
{ name = "The Botanu Authors", email = "oss@botanu.ai" },
]
keywords = [
"opentelemetry",
"tracing",
"observability",
"ai",
"llm",
"cost-attribution",
"mlops",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Monitoring",
"Typing :: Typed",
]
# Core dependency — opentelemetry-api only (~50 KB, zero transitive deps).
# Everything else is behind optional extras so adopters never pay for what
# they don't use.
dependencies = [
"opentelemetry-api >= 1.20.0",
]
[project.urls]
Homepage = "https://github.com/botanu-ai/botanu-sdk-python"
Documentation = "https://docs.botanu.ai"
Repository = "https://github.com/botanu-ai/botanu-sdk-python"
Changelog = "https://github.com/botanu-ai/botanu-sdk-python/blob/main/CHANGELOG.md"
Issues = "https://github.com/botanu-ai/botanu-sdk-python/issues"
# ---------------------------------------------------------------------------
# Optional extras
# ---------------------------------------------------------------------------
[project.optional-dependencies]
# Full OTel SDK + OTLP exporter — needed only when running standalone
# (no pre-existing TracerProvider from Datadog / Splunk / etc.)
sdk = [
"opentelemetry-sdk >= 1.20.0",
"opentelemetry-exporter-otlp-proto-http >= 1.20.0",
]
# Auto-instrumentation libraries for common frameworks
instruments = [
"opentelemetry-instrumentation >= 0.41b0",
"opentelemetry-instrumentation-fastapi >= 0.41b0",
"opentelemetry-instrumentation-requests >= 0.41b0",
"opentelemetry-instrumentation-httpx >= 0.41b0",
"opentelemetry-instrumentation-flask >= 0.41b0",
"opentelemetry-instrumentation-django >= 0.41b0",
"opentelemetry-instrumentation-urllib3 >= 0.41b0",
"opentelemetry-instrumentation-starlette >= 0.41b0",
"opentelemetry-instrumentation-sqlalchemy >= 0.41b0",
"opentelemetry-instrumentation-redis >= 0.41b0",
"opentelemetry-instrumentation-celery >= 0.41b0",
"opentelemetry-instrumentation-grpc >= 0.41b0",
"opentelemetry-instrumentation-logging >= 0.41b0",
]
# GenAI / AI model auto-instrumentation
genai = [
"opentelemetry-instrumentation-openai-v2 >= 2.0b0",
"opentelemetry-instrumentation-anthropic >= 0.1b0",
"opentelemetry-instrumentation-vertexai >= 0.1b0",
"opentelemetry-instrumentation-google-genai >= 0.1b0",
"opentelemetry-instrumentation-langchain >= 0.1b0",
]
# Cross-service carrier propagation (SQS, Kafka, Celery, Redis)
carriers = [
"celery >= 5.0.0",
"aiokafka >= 0.8.0",
]
# Everything
all = [
"botanu[sdk,instruments,genai,carriers]",
]
# Development / CI
dev = [
"botanu[all]",
"pytest >= 7.4.0",
"pytest-asyncio >= 0.21.0",
"pytest-cov >= 4.1.0",
"coverage[toml] >= 7.0",
"httpx >= 0.24.0",
"ruff >= 0.4.0",
"mypy >= 1.7.0",
"pre-commit >= 3.5.0",
]
# ---------------------------------------------------------------------------
# Hatch — build targets & versioning
# ---------------------------------------------------------------------------
[tool.hatch.version]
source = "vcs"
[tool.hatch.version.raw-options]
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"
[tool.hatch.build.targets.sdist]
include = ["src/botanu/**", "LICENSE", "NOTICE", "README.md"]
[tool.hatch.build.targets.wheel]
packages = ["src/botanu"]
# ---------------------------------------------------------------------------
# Ruff (linter + formatter)
# ---------------------------------------------------------------------------
[tool.ruff]
line-length = 120
target-version = "py39"
src = ["src"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"UP", # pyupgrade
"S", # flake8-bandit (security)
"RUF", # ruff-specific
]
ignore = [
"E501", # line too long — handled by formatter
"S101", # assert in tests is fine
"S110", # try-except-pass is intentional in resource detection
"UP006", # dict vs Dict — keep Dict[] for 3.9 compat
"UP007", # X | Y syntax — keep Optional[] for 3.9 compat
"UP035", # typing.Dict deprecated — keep for 3.9 compat
"UP045", # X | None vs Optional — keep Optional[] for 3.9 compat
"RUF002", # ambiguous dash — intentional in docstrings
"RUF022", # __all__ not sorted — grouped logically
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["S101", "S106"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
# ---------------------------------------------------------------------------
# mypy
# ---------------------------------------------------------------------------
[tool.mypy]
python_version = "3.9"
warn_return_any = false
warn_unused_configs = true
ignore_missing_imports = true
strict = false
# OTel SDK types are not always precise; runtime behavior is correct
disable_error_code = ["arg-type", "attr-defined", "operator", "misc"]
# ---------------------------------------------------------------------------
# pytest
# ---------------------------------------------------------------------------
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = [
"--strict-markers",
"--tb=short",
]
markers = [
"integration: marks tests that require external services",
]
# ---------------------------------------------------------------------------
# coverage
# ---------------------------------------------------------------------------
[tool.coverage.run]
source = ["botanu"]
branch = true
[tool.coverage.report]
show_missing = true
fail_under = 70
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"if __name__ == .__main__.",
]
# Exclude integration-heavy modules that require full OTel SDK setup
omit = [
"src/botanu/sdk/bootstrap.py",
"src/botanu/sdk/middleware.py",
]