Skip to content

Commit 5b8c91e

Browse files
committed
✅: pyright
Signed-off-by: nstarman <[email protected]>
1 parent e08019c commit 5b8c91e

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,36 +98,42 @@ jobs:
9898
echo "major=$major" >> $GITHUB_OUTPUT
9999
echo "minor=$minor" >> $GITHUB_OUTPUT
100100
101-
- name: install deps
102-
run: |
103-
uv sync --no-editable --group=mypy
104-
uv pip install numpy==${{ matrix.numpy-version }}
105-
106-
# NOTE: `uv run --with=...` will be ignored by mypy (and `--isolated` does not help)
107-
- name: mypy
101+
- name: collect test files
102+
id: collect-files
108103
run: |
109104
major="${{ steps.numpy-version.outputs.major }}"
110105
minor="${{ steps.numpy-version.outputs.minor }}"
111106
112-
# Directory containing versioned test files
113107
prefix="tests/integration"
114108
files=""
115109
116-
# Find all test files matching the current major version
117-
for path in $(find "$prefix" -name "test_numpy${major}p*.pyi"); do
118-
# Extract file name
110+
while IFS= read -r -d '' path; do
119111
fname=$(basename "$path")
120-
# Parse the minor version from the filename
121112
fminor=$(echo "$fname" | sed -E "s/test_numpy${major}p([0-9]+)\.pyi/\1/")
122-
# Include files where minor version ≤ NumPy's minor
123113
if [ "$fminor" -le "$minor" ]; then
124114
files="$files $path"
125115
fi
126-
done
116+
done < <(find "$prefix" -name "test_numpy${major}p*.pyi" -print0)
127117
118+
files="${files# }"
119+
echo "files=$files" >> "$GITHUB_OUTPUT"
120+
121+
# NOTE: `uv run --with=...` will be ignored by mypy (and `--isolated` does not help)
122+
- name: mypy
123+
run: |
124+
uv sync --no-editable --group=mypy
125+
uv pip install numpy==${{ matrix.numpy-version }}
128126
uv run --no-sync --active \
129127
mypy --tb --no-incremental --cache-dir=/dev/null \
130-
$files
128+
${{ steps.collect-files.outputs.files }}
129+
130+
- name: pyright
131+
run: |
132+
uv sync --no-editable --group=pyright
133+
uv pip install numpy==${{ matrix.numpy-version }}
134+
uv run --no-sync --active \
135+
pyright --no-incremental --cache-dir=/dev/null \
136+
${{ steps.collect-files.outputs.files }}
131137
132138
# TODO: (based)pyright
133139

0 commit comments

Comments
 (0)