-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
193 lines (174 loc) · 5.66 KB
/
Copy pathpyproject.toml
File metadata and controls
193 lines (174 loc) · 5.66 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
[project]
name = "api-observatory"
version = "0.1.0"
requires-python = ">=3.14"
authors = [{ name = "Ivan Prytula", email = "ivanprytula.dev@gmail.com" }]
maintainers = [{ name = "Ivan Prytula", email = "ivanprytula.dev@gmail.com" }]
dependencies = [
"fastapi>=0.139.0",
"uvicorn[standard]>=0.45.0",
"slowapi>=0.1.10",
"sqlalchemy[asyncio]>=2.0.50",
"asyncpg>=0.30.0",
"psycopg[binary]>=3.2",
"pydantic[email]>=2.13.3",
"pydantic-settings>=2.14.2",
"python-json-logger>=4.1.0",
"structlog>=24.4.0",
"pyjwt>=2.10.0",
"argon2-cffi>=23.1.0",
"alembic>=1.18.5",
"httpx>=0.28.1",
"prometheus-fastapi-instrumentator>=8.0.2",
"redis>=8.0.1",
"apscheduler>=3.11.3,<4.0",
"websockets>=14.0",
"python-multipart>=0.0.27",
]
description = "API health observatory — async FastAPI service for monitoring API reliability, drift detection, and scorecard reporting"
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICEN[CS]E.*"]
keywords = ["api", "observatory", "async", "ivan-prytula"]
[project.optional-dependencies]
tracing = [
"opentelemetry-sdk>=1.43.0",
"opentelemetry-instrumentation-fastapi>=0.64b0",
"opentelemetry-instrumentation-sqlalchemy>=0.64b0",
"opentelemetry-exporter-otlp>=1.43.0",
]
messaging = ["aiokafka>=0.11"]
ai = [
"openai>=2.44.0",
"anthropic>=0.75.0",
"langgraph>=1.0.4",
"langgraph-checkpoint-postgres>=3.0.0",
"langchain-anthropic>=0.3.24",
]
etl = [
"pandas>=2.2.3",
"polars[rtcompat]>=1.30.0",
]
monitoring = ["sentry-sdk[fastapi]>=2.19.2"]
http = ["aiohttp>=3.14.0"]
full = [
"opentelemetry-sdk>=1.43.0",
"opentelemetry-instrumentation-fastapi>=0.64b0",
"opentelemetry-instrumentation-sqlalchemy>=0.64b0",
"opentelemetry-exporter-otlp>=1.43.0",
"aiokafka>=0.11",
"openai>=2.44.0",
"anthropic>=0.75.0",
"langgraph>=1.0.4",
"langgraph-checkpoint-postgres>=3.0.0",
"langchain-anthropic>=0.3.24",
"pandas>=2.2.3",
"polars[rtcompat]>=1.30.0",
"sentry-sdk[fastapi]>=2.19.2",
"aiohttp>=3.14.0",
]
[project.urls]
Homepage = "https://github.com/ivanprytula/api-observatory"
Repository = "https://github.com/ivanprytula/api-observatory"
Issues = "https://github.com/ivanprytula/api-observatory/issues"
LinkedIn = "https://linkedin.com/in/ivanprytula"
[tool.uv]
environments = ["sys_platform == 'linux'"]
constraint-dependencies = ["msgpack>=1.2.1"]
[tool.uv.workspace]
members = ["services/ingestor", "services/dashboard", "services/inference", "services/mcp"]
[dependency-groups]
dev = [
"pytest>=9.1.1",
"pytest-asyncio>=0.25.3",
"pytest-cov>=6.1.0",
# respx: mocks httpx.AsyncClient at the transport level, used by services/mcp/tests/
"respx>=0.22.0",
# testcontainers: auto-provision postgres:17-bookworm for local integration tests
# (Docker must be running; CI uses GHA service container instead)
"testcontainers[postgres,redis]>=4.14.2",
"testcontainers-floci>=0.1.1", # Floci integration testing (Docker required)
"pygments>=2.20.0",
"httpx>=0.28.1",
"aiosqlite>=0.20.0", # async SQLite for tests (no real PG needed)
"fakeredis>=2.36.2", # in-memory redis for tests
# Pre-commit hooks & linting
"pre-commit>=4.5.1",
"ruff>=0.15.20",
# Load testing
"locust>=2.44.4",
# k6 is a standalone CLI, install via:
# - Linux: sudo apt install k6
# - macOS: brew install grafana/k6/k6
# - or: https://k6.io/docs/getting-started/installation/
"ty>=0.0.56",
"pip-audit>=2.10.1",
"azure-storage-blob>=12.20.0", # E2E tests against floci-az Blob/Queue
"azure-storage-queue>=12.10.0",
]
[tool.pytest.ini_options]
testpaths = ["tests", "services/ingestor/tests"]
asyncio_mode = "auto"
# Limit coverage collection to the package under test to avoid "module X was never imported" warnings
addopts = "--cov=services/ingestor --cov-report=term-missing --cov-report=html -q -m 'not e2e'"
filterwarnings = [
"ignore::DeprecationWarning:slowapi",
"ignore::DeprecationWarning:fastapi.routing",
]
markers = [
"unit: Fast, isolated unit tests (no I/O, no DB)",
"integration: Tests that touch DB/ASGI client",
"e2e: End-to-end or long-running tests (skipped by default)",
"azure: floci-az Azure emulator dependent tests",
"browser: Browser-based tests using Playwright (may require system dependencies)",
"mongo: MongoDB-dependent tests (skipped if MongoDB unavailable)",
]
[tool.coverage.run]
source = ["services.ingestor"]
omit = ["services/ingestor/__main__.py", "*/migrations/*", "*/alembic/*"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if t.TYPE_CHECKING:",
]
precision = 2
show_missing = true
skip_covered = false
[tool.coverage.html]
directory = "htmlcov"
[tool.ruff]
line-length = 88
target-version = "py314"
extend-exclude = ["alembic/versions"]
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM"]
ignore = [
"SIM117",
"B008",
] # Allow nested with statements and Depends() in defaults (FastAPI pattern)
[tool.ruff.lint.isort]
lines-after-imports = 2
[tool.ruff.lint.pycodestyle]
max-doc-length = 100
max-line-length = 100
[[tool.ty.overrides]]
include = ["services/ingestor", "tests"]
[tool.ty.rules]
unresolved-attribute = "ignore"
[tool.ty.overrides.rules]
unresolved-attribute = "ignore"
invalid-argument-type = "ignore"
# invalid-assignment = "ignore"
[tool.bandit]
exclude_dirs = ["tests", ".venv", "venv"]
skips = [
"B101", # assert_used in tests
"B105", # false positive: Redis key prefixes and session-state token keys flagged as hardcoded passwords
"B107", # false positive: token: str = "" optional-param default flagged as hardcoded password
]