-
-
Notifications
You must be signed in to change notification settings - Fork 33
168 lines (131 loc) · 4.6 KB
/
ci.yml
File metadata and controls
168 lines (131 loc) · 4.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: CI
permissions:
contents: read
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
UV_LOCKED: 1
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: "3.14"
activate-environment: true
# the `scientific-python/repo-review` action (v1.0.3) internally uses an unpinned
# `actions/setup-python@v6`, so we use `uvx` instead.
- name: repo-review
run: >
uvx --from='repo-review[cli]' --with=sp-repo-review
repo-review --format html --stderr rich .
>> $GITHUB_STEP_SUMMARY
- name: dprint
uses: dprint/check@9cb3a2b17a8e606d37aae341e49df3654933fc23 # v2.3
- name: typos
uses: crate-ci/typos@bbaefadf97b0ec5fdc942684b647f1a6ab250274 # v1.46.0
- name: ruff check
run: uv run ruff check --output-format=github
- name: ruff format
run: uv run ruff format --check
# mypy_primer expects pyright to pass
- name: pyright
uses: jakebailey/pyright-action@8ec14b5cfe41f26e5f41686a31eb6012758217ef # v3.0.2
validate_stubs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: setup uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: "3.14"
- name: check version literals
run: uv run scripts/check_version_literals.py
- name: check for unstubbed modules
run: uv run scripts/unstubbed_modules.py
# avoid stubdefaulter checking the tests as if they were stubs
- name: exclude tests
run: rm -rf tests
- name: run stubdefaulter
run: uv run stubdefaulter --check --exit-zero --packages .
typecheck:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
py: ["3.11"]
np: ["1.26", "2.0", "2.1", "2.2", "2.3", "2.4"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
# NOTE: mypy ignores `uv run --with=...` (and `--isolated` does not help), so we
# manually (re)install the desired version directly in the environment.
- name: setup uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
activate-environment: true
python-version: ${{ matrix.py }}
- name: install dependencies
run: uv pip install --exact --group type numpy==${{ matrix.np }}.* .
- name: ty check scipy-stubs
run: ty check --error-on-warning --output-format=github scipy-stubs
- name: pyrefly check scipy-stubs
run: pyrefly check scipy-stubs
- name: basedpyright scipy-stubs
run: basedpyright scipy-stubs
- name: mypy scipy-stubs
run: mypy --no-incremental --cache-dir=/dev/null scipy-stubs
- name: stubtest scipy
run: stubtest --ignore-disjoint-bases --allowlist=.mypyignore scipy
typetest:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
py: ["3.11", "3.12", "3.13", "3.14"]
np: ["1.26", "2.0", "2.1", "2.2", "2.3", "2.4"]
exclude:
- py: "3.13"
np: "1.26"
- py: "3.13"
np: "2.0"
- py: "3.14"
np: "1.26"
- py: "3.14"
np: "2.0"
- py: "3.14"
np: "2.1"
- py: "3.14"
np: "2.2"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
activate-environment: true
python-version: ${{ matrix.py }}
- name: install dependencies
run: uv pip install --exact --group type numpy==${{ matrix.np }}.* .
- name: pyrefly check tests
run: pyrefly check tests
- name: basedpyright tests
run: basedpyright tests
- name: mypy tests
run: mypy --no-incremental --cache-dir=/dev/null tests