@@ -121,28 +121,100 @@ jobs:
121121 # NOTE: `uv run --with=...` will be ignored by mypy (and `--isolated` does not help)
122122 - name : mypy
123123 run : |
124- uv sync --no-editable --group=mypy
124+ uv sync --no-editable --group=test_numpy --group= mypy
125125 uv pip install numpy==${{ matrix.numpy-version }}
126126 uv run --no-sync --active \
127127 mypy --tb --no-incremental --cache-dir=/dev/null \
128128 ${{ steps.collect-files.outputs.files }}
129129
130130 - name : basedmypy
131131 run : |
132- uv sync --no-editable --group=basedmypy
132+ uv sync --no-editable --group=test_numpy --group= basedmypy
133133 uv pip install numpy==${{ matrix.numpy-version }}
134134 uv run --no-sync --active \
135135 mypy --tb --no-incremental --cache-dir=/dev/null \
136136 ${{ steps.collect-files.outputs.files }}
137137
138138 - name : pyright
139139 run : |
140- uv sync --no-editable --group=pyright
140+ uv sync --no-editable --group=test_numpy --group= pyright
141141 uv pip install numpy==${{ matrix.numpy-version }}
142142 uv run --no-sync --active \
143143 pyright ${{ steps.collect-files.outputs.files }}
144144
145145 # TODO: (based)pyright
146146
147+ test_integration_jax :
148+ name : integration tests (jax)
149+ runs-on : ubuntu-latest
150+ strategy :
151+ fail-fast : false
152+ matrix :
153+ jax-version : ["0.7.0"]
154+
155+ steps :
156+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
157+
158+ - uses : astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 # v6.5.0
159+ with :
160+ python-version : " 3.11"
161+ activate-environment : true
162+
163+ - name : get major.minor jax version
164+ id : jax-version
165+ run : |
166+ version="${{ matrix.jax-version }}"
167+ major=$(echo "$version" | cut -d. -f1)
168+ minor=$(echo "$version" | cut -d. -f2)
169+
170+ echo "major=$major" >> $GITHUB_OUTPUT
171+ echo "minor=$minor" >> $GITHUB_OUTPUT
172+
173+ - name : collect test files
174+ id : collect-files
175+ run : |
176+ major="${{ steps.numpy-version.outputs.major }}"
177+ minor="${{ steps.numpy-version.outputs.minor }}"
178+
179+ prefix="tests/integration"
180+ files=""
181+
182+ while IFS= read -r -d '' path; do
183+ fname=$(basename "$path")
184+ fminor=$(echo "$fname" | sed -E "s/test_numpy${major}p([0-9]+)\.pyi/\1/")
185+ if [ "$fminor" -le "$minor" ]; then
186+ files="$files $path"
187+ fi
188+ done < <(find "$prefix" -name "test_numpy${major}p*.pyi" -print0)
189+
190+ files="${files# }"
191+ echo "files=$files" >> "$GITHUB_OUTPUT"
192+
193+ # NOTE: `uv run --with=...` will be ignored by mypy (and `--isolated` does not help)
194+ - name : mypy
195+ run : |
196+ uv sync --no-editable --group=test_jax --group=mypy
197+ uv pip install jax==${{ matrix.jax-version }}
198+ uv run --no-sync --active \
199+ mypy --tb --no-incremental --cache-dir=/dev/null \
200+ ${{ steps.collect-files.outputs.files }}
201+
202+ - name : basedmypy
203+ run : |
204+ uv sync --no-editable --group=test_jax --group=basedmypy
205+ uv pip install jax==${{ matrix.jax-version }}
206+ uv run --no-sync --active \
207+ mypy --tb --no-incremental --cache-dir=/dev/null \
208+ ${{ steps.collect-files.outputs.files }}
209+
210+ - name : pyright
211+ run : |
212+ uv sync --no-editable --group=test_jax --group=pyright
213+ uv pip install jax==${{ matrix.numpy-version }}
214+ uv run --no-sync --active \
215+ pyright ${{ steps.collect-files.outputs.files }}
216+
217+ # TODO: (based)pyright
218+
147219 # TODO: integration tests for array-api-strict
148220 # TODO: integration tests for 3rd party libs such as cupy, pytorch, tensorflow, dask, etc.
0 commit comments