Skip to content

Commit 0bae999

Browse files
authored
Merge pull request #266 from numpy/ci-matrix
👷 typecheck, typetest, and stubtest with multiple python versions
2 parents 03b347f + a1310c0 commit 0bae999

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,48 +35,60 @@ jobs:
3535

3636
basedpyright:
3737
runs-on: ubuntu-latest
38-
timeout-minutes: 2
38+
timeout-minutes: 5
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
py: ["3.10", "3.11", "3.12", "3.13"]
3943
steps:
4044
- uses: actions/checkout@v4
4145

4246
- uses: astral-sh/setup-uv@v5
4347
with:
4448
enable-cache: true
45-
python-version: 3.13t
49+
python-version: ${{ matrix.py }}
4650

47-
- name: basedpyright
51+
- name: basedpyright (python ${{ matrix.py }})
4852
run: >
4953
uv run --no-group=orjson
5054
basedpyright --threads=3
5155
5256
mypy:
5357
runs-on: ubuntu-latest
5458
timeout-minutes: 5
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
py: ["3.10", "3.11", "3.12", "3.13"]
5563
steps:
5664
- uses: actions/checkout@v4
5765

5866
- uses: astral-sh/setup-uv@v5
5967
with:
6068
enable-cache: true
61-
python-version: 3.13
69+
python-version: ${{ matrix.py }}
6270

63-
- name: mypy
71+
- name: mypy (python ${{ matrix.py }})
6472
run: >
6573
uv run --no-group=numpy
66-
mypy --no-incremental test
74+
mypy test
6775
6876
stubtest:
6977
runs-on: ubuntu-latest
70-
timeout-minutes: 10
78+
timeout-minutes: 5
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
py: ["3.10", "3.11", "3.12", "3.13"]
7183
steps:
7284
- uses: actions/checkout@v4
7385

7486
- uses: astral-sh/setup-uv@v5
7587
with:
7688
enable-cache: true
77-
python-version: 3.13
89+
python-version: ${{ matrix.py }}
7890

79-
- name: stubtest
91+
- name: stubtest (python ${{ matrix.py }})
8092
run: >
81-
uv run --no-project
82-
tool/stubtest.py --concise
93+
uv run --active -p ${{ matrix.py }}
94+
tool/stubtest.py

test/static/accept/scalars.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Any, Literal, TypeAlias
2-
from typing_extensions import assert_type
2+
from typing_extensions import Unpack, assert_type
33

44
import numpy as np
55

@@ -121,7 +121,7 @@ assert_type(
121121
S.reshape(1, 1, 1, 1, 1),
122122
np.ndarray[
123123
# len(shape) >= 5
124-
tuple[_1, _1, _1, _1, _1, *tuple[_1, ...]],
124+
tuple[_1, _1, _1, _1, _1, Unpack[tuple[_1, ...]]],
125125
np.dtype[np.bytes_],
126126
],
127127
)

0 commit comments

Comments
 (0)