@@ -98,36 +98,41 @@ jobs:
98
98
echo "major=$major" >> $GITHUB_OUTPUT
99
99
echo "minor=$minor" >> $GITHUB_OUTPUT
100
100
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
108
103
run : |
109
104
major="${{ steps.numpy-version.outputs.major }}"
110
105
minor="${{ steps.numpy-version.outputs.minor }}"
111
106
112
- # Directory containing versioned test files
113
107
prefix="tests/integration"
114
108
files=""
115
109
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
119
111
fname=$(basename "$path")
120
- # Parse the minor version from the filename
121
112
fminor=$(echo "$fname" | sed -E "s/test_numpy${major}p([0-9]+)\.pyi/\1/")
122
- # Include files where minor version ≤ NumPy's minor
123
113
if [ "$fminor" -le "$minor" ]; then
124
114
files="$files $path"
125
115
fi
126
- done
116
+ done < <(find "$prefix" -name "test_numpy${major}p*.pyi" -print0)
127
117
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 }}
128
126
uv run --no-sync --active \
129
127
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 ${{ steps.collect-files.outputs.files }}
131
136
132
137
# TODO: (based)pyright
133
138
0 commit comments