Skip to content

Commit 7f9e8be

Browse files
Configure pyright for flexible typing on tests and SDK boundaries
1 parent c20cdb4 commit 7f9e8be

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

pyproject.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ exclude = [
185185
".venv",
186186
".nox",
187187
".git",
188+
"agentex-server",
188189
]
189190

190191
reportImplicitOverride = true
@@ -193,18 +194,32 @@ reportOverlappingOverload = false
193194
reportImportCycles = false
194195
reportPrivateUsage = false
195196

197+
# Ignore common issues in generated SDK code
198+
reportMissingTypeStubs = false
199+
reportUnknownParameterType = false
200+
reportUnknownMemberType = false
201+
reportUnknownArgumentType = false
202+
reportUnknownVariableType = false
203+
196204
# Enable strict type checking only for hand-written code
197205
[[tool.pyright.executionEnvironments]]
198206
root = "src/agentex/lib"
199207
typeCheckingMode = "strict"
208+
# But allow some flexibility in OpenAI module for complex type boundaries
209+
reportArgumentType = false
200210

201211
[[tool.pyright.executionEnvironments]]
202212
root = "examples"
203213
typeCheckingMode = "strict"
214+
# Allow type ignores in tutorials for readability
215+
reportUnnecessaryTypeIgnoreComment = false
204216

205217
[[tool.pyright.executionEnvironments]]
206218
root = "tests"
207-
typeCheckingMode = "strict"
219+
typeCheckingMode = "basic"
220+
# Be loose on typing in tests unless testing types specifically
221+
reportOptionalMemberAccess = false
222+
reportArgumentType = false
208223

209224
[tool.mypy]
210225
pretty = true

0 commit comments

Comments
 (0)