@@ -88,11 +88,15 @@ jobs:
8888 python-version : " 3.11"
8989 activate-environment : true
9090
91- - name : get major numpy version
92- id : numpy-major
91+ - name : get major.minor numpy version
92+ id : numpy-version
9393 run : |
94- version=$(echo ${{ matrix.numpy-version }} | cut -c 1)
95- echo "::set-output name=version::$version"
94+ version="${{ matrix.numpy-version }}"
95+ major=$(echo "$version" | cut -d. -f1)
96+ minor=$(echo "$version" | cut -d. -f2)
97+
98+ echo "major=$major" >> $GITHUB_OUTPUT
99+ echo "minor=$minor" >> $GITHUB_OUTPUT
96100
97101 - name : install deps
98102 run : |
@@ -101,10 +105,29 @@ jobs:
101105
102106 # NOTE: `uv run --with=...` will be ignored by mypy (and `--isolated` does not help)
103107 - name : mypy
104- run : >
105- uv run --no-sync --active
106- mypy --tb --no-incremental --cache-dir=/dev/null
107- tests/integration/test_numpy${{ steps.numpy-major.outputs.version }}.pyi
108+ run : |
109+ major="${{ steps.numpy-version.outputs.major }}"
110+ minor="${{ steps.numpy-version.outputs.minor }}"
111+
112+ # Directory containing versioned test files
113+ prefix="tests/integration"
114+ files=""
115+
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
119+ fname=$(basename "$path")
120+ # Parse the minor version from the filename
121+ fminor=$(echo "$fname" | sed -E "s/test_numpy${major}p([0-9]+)\.pyi/\1/")
122+ # Include files where minor version ≤ NumPy's minor
123+ if [ "$fminor" -le "$minor" ]; then
124+ files="$files $path"
125+ fi
126+ done
127+
128+ uv run --no-sync --active \
129+ mypy --tb --no-incremental --cache-dir=/dev/null \
130+ $files
108131
109132 # TODO: (based)pyright
110133
0 commit comments