Skip to content

Commit af24393

Browse files
committed
✅: basedpyright
Signed-off-by: nstarman <[email protected]>
1 parent d4078d7 commit af24393

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,25 @@ jobs:
142142
uv run --no-sync --active \
143143
pyright ${{ steps.collect-files.outputs.files }}
144144
145-
# TODO: (based)pyright
145+
- name: basedpyright
146+
run: |
147+
uv sync --no-editable --group=basedpyright
148+
uv pip install numpy==${{ matrix.numpy-version }}
149+
150+
# Copy test files to a temporary directory
151+
tmpdir=$(mktemp -d)
152+
cp -r tests/integration "$tmpdir/"
153+
154+
# Swap mypy-specific ignores to basedpyright-compatible ones
155+
find "$tmpdir/integration" -name "*.pyi" -exec sed -i \
156+
-e 's/# type: ignore\[assignment\]/# type: ignore[reportAssignmentType]/g' {} +
157+
158+
# Run basedpyright on the temporary copy
159+
uv run --no-sync --active \
160+
basedpyright "$tmpdir/integration"
161+
162+
# Clean up
163+
rm -rf "$tmpdir"
146164
147165
# TODO: integration tests for array-api-strict
148166
# TODO: integration tests for 3rd party libs such as cupy, pytorch, tensorflow, dask, etc.

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ pyright = [
6868
basedmypy = [
6969
"basedmypy>=2.10.0",
7070
]
71+
basedpyright = [
72+
"basedpyright>=1.31.2",
73+
]
7174

7275
[tool.hatch]
7376
version.source = "vcs"
@@ -95,6 +98,9 @@ local_partial_types = true
9598
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
9699
warn_unreachable = true
97100

101+
[tool.basedpyright]
102+
reportExplicitAny = "none"
103+
98104
[tool.pytest.ini_options]
99105
addopts = [
100106
"--showlocals",

uv.lock

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

0 commit comments

Comments
 (0)