Skip to content

Commit 5d64cda

Browse files
author
Dylan Huang
authored
fix type checks in IDE (#132)
* fix type checks in IDE * convert to basedpyright and temporarily disable in CI
1 parent b13b630 commit 5d64cda

File tree

5 files changed

+44
-48
lines changed

5 files changed

+44
-48
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ jobs:
4949
run: uv run ruff check .
5050

5151
- name: Type check with pyright
52-
run: uv run pyright
52+
run: |
53+
# 'set +e' disables immediate exit on error so we can capture and report errors but exit 0
54+
# Note: We currently suppress pyright failures to allow CI to pass while we iteratively fix all type issues.
55+
# Once all type errors are resolved, we will remove this suppression and enforce strict type checking.
56+
set +e
57+
uv run basedpyright || true
5358
5459
test-core:
5560
name: Core Tests (Python ${{ matrix.python-version }})

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"anysphere.cursorpyright",
4+
"ms-python.python",
5+
"ms-python.debugpy"
6+
]
7+
}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"python.testing.autoTestDiscoverOnSaveEnabled": true,
66
"python.defaultInterpreterPath": "./.venv/bin/python",
77
"python.testing.cwd": "${workspaceFolder}",
8-
"editor.defaultFormatter": "ms-python.black-formatter"
8+
"cursorpyright.analysis.diagnosticMode": "openFilesOnly"
99
}

pyproject.toml

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ dev = [
6565
"pytest-httpserver",
6666
"werkzeug>=2.0.0",
6767
"ruff>=0.5.0",
68-
"pyright>=1.1.365",
6968
"transformers>=4.0.0",
7069
"types-setuptools",
7170
"types-requests",
@@ -174,6 +173,7 @@ tau2 = { git = "https://github.com/sierra-research/tau2-bench.git" }
174173

175174
[dependency-groups]
176175
dev = [
176+
"basedpyright>=1.31.3",
177177
"fastapi[standard]>=0.116.1",
178178
"fastmcp>=2.10.6",
179179
"haikus==0.3.8",
@@ -204,38 +204,9 @@ known-first-party = ["eval_protocol"]
204204
combine-as-imports = true
205205

206206
[tool.pyright]
207-
typeCheckingMode = "basic"
207+
typeCheckingMode = "recommended"
208208
pythonVersion = "3.10"
209-
reportMissingImports = "none"
210-
reportMissingTypeStubs = "none"
211-
reportMissingModuleSource = "none"
212209
include = ["eval_protocol", "examples", "tests"]
213210
exclude = ["vite-app", "vendor"]
214211
# Ignore diagnostics for vendored generator code
215212
ignore = ["versioneer.py"]
216-
# Relax noisy diagnostics commonly triggered in tests and dynamic libs
217-
reportAttributeAccessIssue = "none"
218-
reportCallIssue = "none"
219-
reportUnknownMemberType = "none"
220-
reportUnknownVariableType = "none"
221-
reportPossiblyUnboundVariable = "none"
222-
# Additional suppressions per request
223-
reportOptionalMemberAccess = "none"
224-
reportIndexIssue = "none"
225-
reportReturnType = "none"
226-
reportOptionalCall = "none"
227-
reportGeneralTypeIssues = "none"
228-
reportOperatorIssue = "none"
229-
reportOptionalSubscript = "none"
230-
reportUnsupportedDunderAll = "none"
231-
reportOptionalContextManager = "none"
232-
reportInvalidTypeForm = "none"
233-
reportRedeclaration = "none"
234-
reportUndefinedVariable = "none"
235-
reportPrivateImportUsage = "none"
236-
reportOptionalIterable = "none"
237-
# Make incompatibilities and argument types warnings instead of errors for now
238-
# and suppress warnings output entirely
239-
reportIncompatibleVariableOverride = "none"
240-
reportArgumentType = "none"
241-
reportAssignmentType = "none"

uv.lock

Lines changed: 28 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)