@@ -192,43 +192,93 @@ uv sync --frozen
192
192
### pre-commit
193
193
194
194
` scipy-stubs ` uses [ pre-commit] ( https://pre-commit.com/ ) to ensure that the code is
195
- formatted and typed correctly when committing the changes.
195
+ formatted and typed correctly when committing the changes. For better performance,
196
+ you could additionally install [ ` pre-commit-uv ` ] ( https://github.com/tox-dev/pre-commit-uv ) :
196
197
197
198
``` bash
198
- poe pre-commit
199
+ uv tool install pre-commit --with pre-commit-uv --force-reinstall
200
+ ```
201
+
202
+ <details >
203
+ <summary >Output:</summary >
204
+
205
+ ``` plaintext
206
+ Resolved 11 packages in 74ms
207
+ Prepared 11 packages in 1ms
208
+ Uninstalled 11 packages in 9ms
209
+ Installed 11 packages in 10ms
210
+ ~ cfgv==3.4.0
211
+ ~ distlib==0.3.9
212
+ ~ filelock==3.17.0
213
+ ~ identify==2.6.6
214
+ ~ nodeenv==1.9.1
215
+ ~ platformdirs==4.3.6
216
+ ~ pre-commit==4.1.0
217
+ ~ pre-commit-uv==4.1.4
218
+ ~ pyyaml==6.0.2
219
+ ~ uv==0.5.23
220
+ ~ virtualenv==20.29.1
221
+ Installed 1 executable: pre-commit
222
+ ```
223
+
224
+ </details >
225
+
226
+ Now to install the git hook script, make sure that your the root directory of the ` scipy-stubs ` repo, then run:
227
+
228
+ ``` bash
229
+ uvx pre-commit install
230
+ ```
231
+
232
+ Output:
233
+
234
+ ``` plaintext
235
+ pre-commit installed at .git/hooks/pre-commit
199
236
```
200
237
201
238
> [ !NOTE]
202
- > Pre-commit doesn't run ` stubtest ` . This will be run by github actions
203
- > when submitting a pull request. See the next section for more details.
239
+ > For performance reasons, ` pre-commit ` won't run ` mypy ` and ` stubtest ` . You could do this
240
+ > yourself with ` tox -e mypy ` and ` tox -e stubtest ` , as explained in the next section.
241
+ > That way you won't have to rely on the (slow) github actions workflow when you submit your PR.
204
242
205
243
### Tox
206
244
207
245
The pre-commit hooks and ` stubtest ` can easily be run with [ tox] ( https://github.com/tox-dev/tox ) .
208
246
It can be installed with:
209
247
210
248
``` bash
211
- uv tool install tox --with tox-uv
249
+ uv tool install tox --with tox-uv --upgrade
212
250
```
213
251
214
252
To run all environments in parallel, run:
215
253
216
- ``` shell
217
- $ tox -p all
218
- repo-review: OK β in 0.4 seconds
219
- 3.12: OK β in 10.38 seconds
220
- 3.10: OK β in 10.62 seconds
221
- 3.11: OK β in 11.04 seconds
222
- 3.13: OK β in 19.42 seconds
223
- repo-review: OK (0.40=setup[0.04]+cmd[0.36] seconds)
224
- pre-commit: OK (24.91=setup[0.04]+cmd[24.87] seconds)
225
- 3.10: OK (10.62=setup[0.11]+cmd[10.51] seconds)
226
- 3.11: OK (11.04=setup[0.04]+cmd[11.00] seconds)
227
- 3.12: OK (10.38=setup[0.04]+cmd[10.34] seconds)
228
- 3.13: OK (19.42=setup[0.04]+cmd[19.38] seconds)
229
- congratulations :) (24.96 seconds)
254
+ ``` bash
255
+ uvx tox p
230
256
```
231
257
258
+ <details >
259
+ <summary >Output:</summary >
260
+
261
+ ``` plaintext
262
+ lint: OK β in 0.52 seconds
263
+ pre-commit: OK β in 2.59 seconds
264
+ 3.11: OK β in 21.59 seconds
265
+ mypy: OK β in 21.62 seconds
266
+ pyright: OK β in 25.23 seconds
267
+ 3.10: OK β in 25.4 seconds
268
+ 3.12: OK β in 38.71 seconds
269
+ pre-commit: OK (2.59=setup[0.03]+cmd[2.56] seconds)
270
+ lint: OK (0.52=setup[0.04]+cmd[0.41,0.03,0.05] seconds)
271
+ pyright: OK (25.23=setup[0.03]+cmd[25.20] seconds)
272
+ mypy: OK (21.62=setup[0.03]+cmd[21.59] seconds)
273
+ 3.13: OK (53.28=setup[0.03]+cmd[53.25] seconds)
274
+ 3.12: OK (38.71=setup[0.03]+cmd[38.68] seconds)
275
+ 3.11: OK (21.59=setup[0.03]+cmd[21.55] seconds)
276
+ 3.10: OK (25.40=setup[0.03]+cmd[25.36] seconds)
277
+ congratulations :) (53.35 seconds)
278
+ ```
279
+
280
+ </details >
281
+
232
282
### Commit message style
233
283
234
284
See < https://gitmoji.dev/ > .
0 commit comments