-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpyproject.toml
More file actions
268 lines (254 loc) · 7.39 KB
/
pyproject.toml
File metadata and controls
268 lines (254 loc) · 7.39 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
[project]
name = "grantflow"
version = "0.1.0"
description = "GrantFlow Monorepo"
readme = "README.md"
license = { text = "UNLICENSED" }
requires-python = "==3.13.*"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"scikit-learn>=1.8.0",
"textstat>=0.7.12",
]
[dependency-groups]
dev = [
"asyncpg>=0.31.0",
"codespell>=2.4.0",
"covdefaults>=2.3.0",
"faker>=40.1.0",
"firebase-admin>=7.0.0",
"google-cloud-pubsub>=2.34.0",
"greenlet>=3.3.0",
"litestar>=2.19.0",
"mypy>=1.19.1",
"opentelemetry-api>=1.39.1",
"opentelemetry-exporter-gcp-trace>=1.9.0",
"opentelemetry-instrumentation>=0.60b1",
"opentelemetry-instrumentation-httpx>=0.60b1",
"opentelemetry-instrumentation-sqlalchemy>=0.60b1",
"opentelemetry-sdk>=1.39.1",
"pgvector>=0.4.2",
"polyfactory>=3.2.0",
"pyproject-fmt>=2.6.0",
"pytest>=9.0.2",
"pytest-asyncio>=0.25.3",
"pytest-cov>=6.0.0",
"pytest-mock>=3.14.0",
"pytest-timeout>=2.3.1",
"python-dotenv>=1.0.1",
"pyyaml>=6.0.2",
"ruff>=0.14.11",
"sqlalchemy>=2.0.45",
"structlog>=25.4.0",
"testcontainers[postgres]>=4.14.0",
"uv-bump",
]
functions = [
"asyncpg>=0.31.0",
"db",
"functions-framework>=3.8.2",
"google-cloud-pubsub>=2.34.0",
"msgspec>=0.20.0",
"shared-utils",
"sqlalchemy[asyncio]>=2.0.45",
"structlog>=25.4.0",
]
[tool.uv.workspace]
members = [
"packages/db",
"packages/shared_utils",
"packages/shared-testing",
"services/backend",
"services/crawler",
"services/indexer",
"services/rag",
"services/scraper",
]
[tool.uv.sources]
db = { workspace = true }
shared-testing = { workspace = true }
shared-utils = { workspace = true }
uv-bump = { git = "https://github.com/Goldziher/uv-bump" }
[tool.ruff]
target-version = "py313"
line-length = 120
src = [
"packages/**/src",
"packages/**/tests",
"services/**/src",
"services/**/tests",
]
format.docstring-code-line-length = 120
format.docstring-code-format = true
lint.select = [ "ALL" ]
lint.ignore = [
"ANN401", # Dynamically typed ANY
"ASYNC109", # Async function definition with a timeout parameter
"ASYNC110", # Use Event instead of sleep in async loop
"BLE001", # Do not catch blind exception - we allow this pattern
"COM812", # Conflicts with formatter
"D", # Doc strings
"E501", # Line too long, handled by ruff format
"EM", # Exception messages,
"FBT", # Boolean-typed positional argument in function definition
"FIX", # We allow todo and fixme comments
"ISC001", # Conflicts with formatter
"PD011", # Creates false positives
"PGH003", # Required specific mypy ignores
"PLR2004", # Magic variables, we allow them
"S104", # Disallows using '0.0.0.0' as a host
"TD", # We allow todo and fixme comments
"TRY", # Try except block, rules are too strict
]
lint.per-file-ignores."**/tests/**/*.*" = [
"ARG",
"D",
"N815",
"PLC0415",
"PT006",
"PT007",
"PT012",
"PT013",
"RUF012",
"S",
"SLF001", # Allow accessing private members in tests
]
lint.per-file-ignores."e2e/**/*.*" = [
"ARG001",
"D",
"EXE002",
"N815",
"PT006",
"PT007",
"PT012",
"PT013",
"RUF012",
"S",
]
lint.per-file-ignores."packages/db/alembic/**/*.*" = [ "INP001" ]
# Lint overrides for packages/shared-testing - test infrastructure code
lint.per-file-ignores."packages/shared-testing/**/*.*" = [
"ARG001", # Unused function arguments (pytest fixtures with side effects)
"S101", # Use of assert (normal in test utilities)
"S311", # Use of random.choice() (non-cryptographic test data generation)
"S608", # SQL injection warnings (false positives for controlled test DB operations)
]
lint.per-file-ignores."scripts/**/*.*" = [
"ARG001",
"BLE001",
"D",
"DTZ003",
"G004",
"N999",
"S",
]
lint.per-file-ignores."services/rag/src/autofill/base_handler.py" = [
"B027",
] # Allow empty method in base class
# Temporary overrides for OLD testing/ directory (will be removed in Phase 6)
lint.per-file-ignores."testing/**/*.*" = [
"ARG001",
"D",
"N815",
"PT006",
"PT007",
"PT012",
"PT013",
"RUF012",
"S",
"S101",
]
lint.isort.known-first-party = [ "src", "tests" ]
lint.mccabe.max-complexity = 25
lint.pydocstyle.convention = "google"
lint.pylint.max-args = 15
lint.pylint.max-branches = 25
lint.pylint.max-returns = 10
lint.pylint.max-statements = 120
[tool.codespell]
ignore-words-list = "Bu,COo,bu,TAHt,UE,Mater,CROs,devlop,vEw,afterAll,beforeAll,TE,wasn,mor,couldn,ROUGE,STARD"
skip = "*/e2e/*,**/e2e/**,pnpm-lock.yaml,*.spec.ts,*.spec.tsx,*_test.py,*/tests/*,**/tests/**,*/coverage/*,**/coverage/**,**/functions/**,*/dist/*,**/dist/**,scripts/**"
[tool.pyproject-fmt]
keep_full_version = true
max_supported_python = "3.13"
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
timeout = 600
markers = [
"smoke: Quick smoke tests (< 1 min)",
"quality_assessment: Quality assessment tests (2-5 min)",
"e2e: End-to-end tests that make real external API calls",
"e2e_full: Complete e2e tests (10+ min)",
"slow: All slow tests",
"grant_application: Grant application related tests",
"grant_template: Grant template related tests",
"retrieval: Document retrieval and search tests",
"nlp_categorization: NLP text categorization tests",
"indexer: Document indexing service tests",
"crawler: Web crawling service tests",
"scraper: Web scraping service tests",
"optimization: Performance optimization tests",
"semantic_evaluation: Semantic similarity evaluation tests",
"ai_eval: AI-powered evaluation tests",
"vector_benchmark: Vector database performance benchmarks",
"benchmark: All benchmark tests",
"benchmark_vector: Vector-specific benchmarks",
"benchmark_database: Database performance benchmarks",
"benchmark_api: API performance benchmarks",
]
filterwarnings = [
"ignore::DeprecationWarning:pkg_resources.*",
"ignore::DeprecationWarning:google.*",
"ignore::DeprecationWarning:websockets.*",
"ignore::DeprecationWarning:fake_http_header.*",
"ignore::DeprecationWarning:importlib.resources.*",
"ignore::DeprecationWarning:tracerite.*",
"ignore::DeprecationWarning:spacy.*",
"ignore::DeprecationWarning:weasel.*",
"ignore:pkg_resources is deprecated:UserWarning:google.*",
"ignore:Use of deprecated default '__check_model__':DeprecationWarning:polyfactory.*",
]
# Run tests serially without retries for stability
addopts = [
"--strict-markers", # Ensure all markers are registered
"--tb=short", # Shorter traceback format for better readability in CI
]
testpaths = [ "packages/*/tests", "services/*/tests" ]
[tool.coverage.run]
plugins = [ "covdefaults" ]
omit = [ "services/**/tests/*", "packages/**/tests/*" ]
source = [ "services/**/src", "packages/**/src" ]
[tool.coverage.report]
exclude_lines = [ 'if TYPE_CHECKING:' ]
[tool.mypy]
python_version = "3.13"
disable_error_code = 'import-untyped'
implicit_reexport = false
show_error_codes = true
strict = true
namespace_packages = true
explicit_package_bases = true
mypy_path = [ "." ]
exclude = [ "^functions/.*", "^terraform/.*" ]
[[tool.mypy.overrides]]
module = [
"google.cloud.*",
"google.cloud.firestore",
"google.cloud.firestore_v1",
"google.cloud.pubsub_v1",
"firebase_admin.*",
"firebase_functions.*",
]
ignore_missing_imports = true
follow_imports = "skip"
no_implicit_reexport = false
[[tool.mypy.overrides]]
module = [
"*.tests.*",
"tests.*",
]
disable_error_code = [ "misc" ]