66 - id : check-useless-excludes
77 # - id: identity # Prints all files passed to pre-commits. Debugging.
88 - repo : https://github.com/lyz-code/yamlfix
9- rev : 1.17.0
9+ rev : 1.19.1
1010 hooks :
1111 - id : yamlfix
1212 exclude : tests/optimagic/optimizers/_pounders/fixtures
@@ -18,20 +18,29 @@ repos:
1818 language : python
1919 always_run : true
2020 require_serial : true
21+ - repo : local
22+ hooks :
23+ - id : check-mypy-versions
24+ name : verify that pre-commits and dev env use the same mypy version
25+ entry : python .tools/check_mypy_versions.py
26+ language : python
27+ always_run : true
28+ require_serial : true
29+ additional_dependencies :
30+ - pyyaml
2131 - repo : local
2232 hooks :
2333 - id : update-algo-selection-code
2434 name : update algo selection code
25- entry : bash .tools/create_and_format_algo_selection_code.sh
35+ entry : python .tools/update_algo_selection_hook.py
2636 language : python
27- files : (src/optimagic/optimizers/.|src/optimagic/algorithms.py|.tools/.)
28- always_run : false
37+ files : ^(src/optimagic/optimizers/|src/optimagic/algorithms\.py|\.tools/)
2938 require_serial : true
3039 additional_dependencies :
3140 - hatchling
3241 - ruff
3342 - repo : https://github.com/pre-commit/pre-commit-hooks
34- rev : v5 .0.0
43+ rev : v6 .0.0
3544 hooks :
3645 - id : check-added-large-files
3746 args :
@@ -63,12 +72,12 @@ repos:
6372 exclude : docs/
6473 - id : check-ast
6574 - repo : https://github.com/adrienverge/yamllint.git
66- rev : v1.35.1
75+ rev : v1.38.0
6776 hooks :
6877 - id : yamllint
6978 exclude : tests/optimagic/optimizers/_pounders/fixtures
7079 - repo : https://github.com/PyCQA/docformatter
71- rev : eb1df34
80+ rev : v1.7.7
7281 hooks :
7382 - id : docformatter
7483 args :
8089 - --blank
8190 exclude : src/optimagic/optimization/algo_options.py
8291 - repo : https://github.com/astral-sh/ruff-pre-commit
83- rev : v0.7.2
92+ rev : v0.14.14
8493 hooks :
8594 # Run the linter.
8695 - id : ruff
@@ -97,7 +106,7 @@ repos:
97106 - pyi
98107 - jupyter
99108 - repo : https://github.com/executablebooks/mdformat
100- rev : 0.7.18
109+ rev : 1.0.0
101110 hooks :
102111 - id : mdformat
103112 additional_dependencies :
@@ -109,7 +118,7 @@ repos:
109118 - ' 88'
110119 files : (README\.md)
111120 - repo : https://github.com/executablebooks/mdformat
112- rev : 0.7.18
121+ rev : 1.0.0
113122 hooks :
114123 - id : mdformat
115124 additional_dependencies :
@@ -121,7 +130,7 @@ repos:
121130 files : (docs/.)
122131 exclude : docs/source/how_to/how_to_specify_algorithm_and_algo_options.md
123132 - repo : https://github.com/kynan/nbstripout
124- rev : 0.8 .0
133+ rev : 0.9 .0
125134 hooks :
126135 - id : nbstripout
127136 exclude : |
@@ -132,21 +141,25 @@ repos:
132141 args :
133142 - --drop-empty-cells
134143 - repo : https://github.com/pre-commit/mirrors-mypy
135- rev : v1.13.0
144+ rev : v1.19.1
136145 hooks :
137146 - id : mypy
138147 files : src|tests
139148 additional_dependencies :
140- - numpy
149+ - numpy >= 2
141150 - packaging
142151 - pandas-stubs
143152 - sqlalchemy-stubs
144153 - types-cffi
145154 - types-openpyxl
146155 - types-jinja2
147- args :
148- - --config=pyproject.toml
156+ - bokeh
149157ci :
150158 autoupdate_schedule : monthly
151159 skip :
152160 - update-algo-selection-code
161+ # Skip mypy stubtest on pre-commit.ci due to maximum size limitations. This is
162+ # unlikely to get better in the future as dependencies keep growing. Local runs
163+ # of pre-commit would still execute stubtest. For CI, we have a separate GitHub
164+ # Action that runs stubtest.
165+ - mypy
0 commit comments