Skip to content

Commit 238d389

Browse files
jorenhamjulvdb
authored andcommitted
💚 fix CI numpy testing matrix
1 parent 7304e86 commit 238d389

File tree

1 file changed

+78
-53
lines changed

1 file changed

+78
-53
lines changed

‎.github/workflows/ci.yml

Lines changed: 78 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
with:
4040
activate-environment: true
4141
python-version: "3.13"
42-
version: "0.8.3"
4342

4443
- name: ruff
4544
run: |
@@ -50,75 +49,101 @@ jobs:
5049
- name: pyright
5150
uses: jakebailey/[email protected]
5251

53-
generate-matrix:
54-
name: Generate Test Matrix
52+
# generate-matrix:
53+
# name: Generate Test Matrix
54+
# runs-on: ubuntu-latest
55+
# timeout-minutes: 1
56+
57+
# outputs:
58+
# matrix: ${{ steps.set-matrix.outputs.matrix }}
59+
60+
# steps:
61+
# - uses: actions/[email protected]
62+
63+
# - name: Install uv
64+
# uses: astral-sh/[email protected]
65+
# with:
66+
# python-version: "3.13"
67+
68+
# - name: Generate Matrix
69+
# id: set-matrix
70+
# shell: bash
71+
# run: |
72+
# matrix=$(uv run scripts/generate_matrix.py | jq -c)
73+
# echo "matrix=$matrix" >> $GITHUB_OUTPUT
74+
75+
typecheck:
5576
runs-on: ubuntu-latest
56-
timeout-minutes: 1
77+
timeout-minutes: 5
5778

58-
outputs:
59-
matrix: ${{ steps.set-matrix.outputs.matrix }}
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
py: ["3.11"]
83+
np: ["1.25", "2.0", "2.1", "2.2", "2.3"]
6084

6185
steps:
6286
- uses: actions/[email protected]
6387

64-
- uses: astral-sh/[email protected]
88+
- name: setup uv
89+
uses: astral-sh/[email protected]
6590
with:
66-
python-version: "3.13"
67-
version: "0.8.3"
91+
activate-environment: true
92+
python-version: ${{ matrix.py }}
6893

69-
- name: Generate Matrix
70-
id: set-matrix
71-
shell: bash
72-
run: |
73-
matrix=$(uv run scripts/generate_matrix.py | jq -c)
74-
echo "matrix=$matrix" >> $GITHUB_OUTPUT
94+
# NOTE: mypy ignores `uv run --with=...` (and `--isolated` does not help), so we
95+
# manually (re)install the desired version directly in the environment.
96+
- name: sync env
97+
run: uv sync --no-editable
98+
99+
- name: install specific numpy version
100+
run: uv pip install --upgrade "numpy-typing-compat==${{ matrix.np }}.*"
101+
102+
- name: basedpyright scipy-stubs
103+
run: basedpyright scipy-stubs
104+
105+
- name: mypy scipy-stubs
106+
run: mypy --no-incremental --cache-dir=/dev/null scipy-stubs
107+
108+
- name: stubtest scipy
109+
run: stubtest --allowlist=.mypyignore scipy
75110

76111
typetest:
77-
needs: generate-matrix
112+
# needs: generate-matrix
78113
runs-on: ubuntu-latest
79-
timeout-minutes: 3
114+
timeout-minutes: 5
80115

81116
strategy:
82117
fail-fast: false
83-
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
118+
matrix:
119+
py: ["3.11", "3.12", "3.13"]
120+
np: ["1.25", "2.0", "2.1", "2.2", "2.3"]
121+
exclude:
122+
- py: "3.12"
123+
np: "1.25"
124+
- py: "3.13"
125+
np: "1.25"
126+
- py: "3.13"
127+
np: "2.0"
84128

85129
steps:
86130
- uses: actions/[email protected]
87131

88132
- uses: astral-sh/[email protected]
89133
with:
90-
python-version: ${{ matrix.python }}
91-
version: "0.8.3"
92-
93-
- name: basedpyright
94-
run: >
95-
uv run
96-
-p ${{ matrix.python }}
97-
--with="numpy==${{ matrix.numpy }}"
98-
--no-editable
99-
basedpyright
100-
101-
- name: mypy
102-
run: >
103-
uv run
104-
-p ${{ matrix.python }}
105-
--with="numpy==${{ matrix.numpy }}"
106-
--no-editable
107-
mypy
108-
--tb
109-
--hide-error-context
110-
--hide-error-code-links
111-
--no-incremental
112-
--cache-dir=/dev/null
113-
--soft-error-limit=-1
114-
.
115-
116-
- name: stubtest
117-
run: >
118-
uv run
119-
-p ${{ matrix.python }}
120-
--with="numpy==${{ matrix.numpy }}"
121-
--no-editable
122-
stubtest
123-
--allowlist=.mypyignore
124-
scipy
134+
activate-environment: true
135+
python-version: ${{ matrix.py }}
136+
137+
# NOTE: mypy ignores `uv run --with=...` (and `--isolated` does not help), so we
138+
# manually (re)install the desired version directly in the environment.
139+
- name: sync env
140+
run: uv sync --no-editable
141+
142+
- name: install specific numpy version
143+
run: uv pip install --upgrade "numpy-typing-compat==${{ matrix.np }}.*"
144+
145+
- name: basedpyright tests
146+
run: basedpyright tests
147+
148+
- name: mypy tests
149+
run: mypy --no-incremental --cache-dir=/dev/null --soft-error-limit=-1 tests

0 commit comments

Comments
 (0)