Skip to content

Commit 4820a89

Browse files
committed
Unpin pre-commit version in tox
The config uses the `pre-commit/pre-commit-hook` repository which since v5.0 has multiple hooks using the `pre-commit` stage which was only added in pre-commit [3.2.0][] causing a run failure when run under a pre-commit pinned to 2.2. From a very surface looks it seems like https://pre-commit.ci/ is anal about keeping everything on latest so pinning pre-commit in tox seems like it can only cause problems (by drifting behind the actual CI). Of note: it looks like the `minimum_pre_commit_version` stricture on hooks does not do anything: all the `pre-commit` hooks are filtered on version except [`destroyed-symlinks`][] but I get an error on `check-added-large-file`: ==> At Hook(id='check-added-large-files') ==> At key: stages ==> At index 0 =====> Expected one of commit, commit-msg, manual, merge-commit, post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, push but got: 'pre-commit' [3.2.0]: https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md#320---2023-03-17 [`destroyed-symlinks`]: pre-commit/pre-commit-hooks@c7d1e85
1 parent 7588243 commit 4820a89

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
minimum_pre_commit_version: '3.20'
12
ci:
23
skip: [pylint]
34

@@ -136,7 +137,7 @@ repos:
136137
name: mypy
137138
args: []
138139
additional_dependencies:
139-
["isort>=5", "platformdirs==2.2.0", "py==1.11", "tomlkit>=0.10.1"]
140+
["isort>=5", "platformdirs==2.2.0", "py==1.11", "tomlkit>=0.10.1", "types-requests"]
140141
exclude: tests(/\w*)*/functional/|tests/input|tests(/.*)+/conftest.py|doc/data/messages|tests(/\w*)*data/
141142
- repo: https://github.com/rbubley/mirrors-prettier
142143
rev: v3.6.2

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ commands =
2121
[testenv:mypy]
2222
basepython = python3
2323
deps =
24-
pre-commit~=2.20
24+
types-requests
25+
pre-commit
2526
commands =
2627
pre-commit run mypy --all-files
2728

0 commit comments

Comments
 (0)