-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpyproject.toml
256 lines (226 loc) · 6.13 KB
/
pyproject.toml
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
[tool.poetry]
name = "kollektiv"
version = "0.1.6"
description = ""
authors = ["AZ <[email protected]>"]
readme = "README.md"
package-mode = false
packages = [{ include = "src" }]
[tool.poetry.dependencies]
python = ">=3.12,<3.13"
openai = "^1.42.0"
colorama = "^0.4.6"
requests = "^2.32.3"
tiktoken = "^0.7.0"
markdown = "^3.7"
cohere = "^5.9.0"
firecrawl-py = "^1.2.3"
jq = "^1.8.0"
weave = "^0.51.12"
wandb = "^0.18.3"
anthropic = "^0.37.1"
ragas = "^0.2.3"
pydantic-settings = "^2.6.1"
supabase = "^2.10.0"
postgrest = "^0.18.0"
libmagic = "^1.0"
sentry-sdk = { extras = ["fastapi"], version = "^2.19.0" }
sentry-cli = "^2.39.1"
sse-starlette = "^2.1.3"
redis = { version = "^5.2.1", extras = ["hiredis"] }
chromadb = "^0.5.23"
types-pyyaml = "^6.0.12.20241221"
logfire = { extras = [
"asyncpg",
"fastapi",
"httpx",
"redis",
"system-metrics",
], version = "^2.11.0" }
asyncpg = "^0.30.0"
ngrok = "^1.4.0"
celery = "^5.4.0"
fastapi = { extras = ["standard"], version = "^0.115.6" }
uvicorn = { extras = ["standard"], version = "^0.34.0" }
flower = "^2.0.1"
[tool.poetry.group.dev.dependencies]
pytest = "^8.3.3"
pre-commit = "^4.0.1"
ruff = "^0.7.3"
mypy = "^1.13.0"
pytest-cov = "^6.0.0"
pytest-asyncio = "^0.24.0"
types-requests = "^2.32.0.20241016"
types-pytz = "^2024.2.0.20241003"
types-aiofiles = "^24.1.0.20240626"
types-colorama = "^0.4.15.20240311"
types-markdown = "^3.7.0.20240822"
fakeredis = "^2.26.2"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
crawl = "src.core.content.crawler.crawler:run_crawler"
api = "src.app:run"
worker = "src.infra.celery.worker:run_worker"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q"
testpaths = ["tests"]
pythonpath = [".", "src"]
asyncio_mode = "auto"
filterwarnings = ["ignore::DeprecationWarning", "ignore::UserWarning"]
markers = [
"integration: mark test as integration test",
"e2e: mark test as end-to-end test",
"slow: mark test as slow running",
]
[tool.coverage.run]
source = ["src"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if __name__ == .__main__.:",
"raise NotImplementedError",
"pass",
"except ImportError:",
]
show_missing = true
skip_covered = true
skip_empty = true
precision = 2
[tool.mypy]
python_version = "3.12"
ignore_missing_imports = false
disallow_untyped_defs = true
check_untyped_defs = true
warn_return_any = true
warn_unreachable = true
# Add these to handle __init__ specifically
disallow_incomplete_defs = true
no_implicit_optional = true
plugins = ["pydantic.mypy"]
# Ignore noise
disable_error_code = [
"attr-defined", # Ignore dynamic attribute access
"no-untyped-call", # Ignore calls to untyped functions
"misc", # Ignore misc issues like untyped decorators
"union-attr", # Ignore union attribute access
"type-arg", # Reduces generic type noise
"var-annotated", # Reduces variable annotation noise
"return-value", # Less strict on return value matching
]
# For cleaner output
warn_unused_ignores = false
warn_redundant_casts = false
disallow_subclassing_any = false
disallow_any_explicit = false
# Handle third-party libs that need stubs
[[tool.mypy.overrides]]
module = [
"pytz.*",
"aiofiles.*",
"chainlit.*",
"weave.*",
"ragas.*",
"wandb.*",
"cohere.*",
]
ignore_missing_imports = true
# More relaxed settings for tests
[[tool.mypy.overrides]]
module = ["tests.*"]
disallow_untyped_defs = false # Allow untyped definitions
check_untyped_defs = false # Don't check untyped definitions
warn_return_any = false # Don't warn about implicit Any returns
warn_unused_ignores = true
no_implicit_optional = false
disallow_incomplete_defs = false
disallow_untyped_decorators = false
# Strict settings for core business logic
[[tool.mypy.overrides]]
module = ["src.core.*"]
disallow_untyped_defs = true
check_untyped_defs = true
warn_return_any = true
strict_optional = true
[tool.ruff]
line-length = 120
target-version = "py312"
indent-width = 4
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".pytype",
".ruff_cache",
".ipynb_checkpoints",
"__pypackages__",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"D", # pydocstyle
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"PT", # flake8-pytest-style
"S", # Bandit security rules
"N", # pep8-naming
"TCH", # typechecking
"PYI", # pyi
"ANN", # type annotation checks
]
fixable = ["ALL"]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
ignore = [
"D100", # Missing docstring in public module
"D212", # Multi-line docstring should start at the first line
"D107", # Missing docstring in __init__
"D415", # First line should end with period
"ANN101", # Missing type annotation for self in method
"ANN102", # Missing type annotation for cls in classmethod
"ANN002", # Missing type annotation for *args
"ANN003", # Missing type annotation for **kwargs
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"ANN204", # Missing return type annotation for special method __init__
"E203", # Whitespace before ':'
"E266", # Too many leading '#' for block comment
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "D100", "D104", "D107", "D212"]
"tests/*" = [
"D100",
"D101",
"D102",
"D103",
"S101",
"ANN001",
"ANN201",
"ANN101", # Type annotation rules
]
[tool.ruff.lint.pydocstyle]
convention = "google"
ignore-decorators = ["property", "classmethod", "staticmethod"]
[tool.ruff.lint.isort]
known-third-party = ["anthropic", "openai", "pydantic"]
known-first-party = ["src"]
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
[tool.ruff.lint.pycodestyle]
ignore-overlong-task-comments = true