File tree 4 files changed +14
-24
lines changed 4 files changed +14
-24
lines changed Original file line number Diff line number Diff line change 1
1
exclude : ' ^(mypyc/external/)|(mypy/typeshed/)|misc/typeshed_patches' # Exclude all vendored code from lints
2
2
repos :
3
3
- repo : https://github.com/pre-commit/pre-commit-hooks
4
- rev : v4.5.0 # must match test-requirements.txt
4
+ rev : v4.5.0
5
5
hooks :
6
6
- id : trailing-whitespace
7
7
- id : end-of-file-fixer
8
8
- repo : https://github.com/psf/black-pre-commit-mirror
9
- rev : 24.8.0 # must match test-requirements.txt
9
+ rev : 24.8.0
10
10
hooks :
11
11
- id : black
12
12
exclude : ' ^(test-data/)'
13
13
- repo : https://github.com/astral-sh/ruff-pre-commit
14
- rev : v0.6.9 # must match test-requirements.txt
14
+ rev : v0.6.9
15
15
hooks :
16
16
- id : ruff
17
17
args : [--exit-non-zero-on-fix]
Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ First install any additional dependencies needed for testing:
100
100
101
101
python3 -m pip install -U -r test-requirements.txt
102
102
103
+ Configure ` pre-commit ` to run the linters automatically when you commit:
104
+
105
+ pre-commit install
106
+
103
107
The unit test suites are driven by the ` pytest ` framework. To run all mypy tests,
104
108
run ` pytest ` in the mypy repository:
105
109
@@ -157,9 +161,11 @@ To run mypy on itself:
157
161
158
162
python3 -m mypy --config-file mypy_self_check.ini -p mypy
159
163
160
- To run the linter:
164
+ To run the linter (this commands just wraps ` pre-commit ` , so you can also
165
+ invoke it directly like ` pre-commit run -a ` , and this will also run when you
166
+ ` git commit ` if enabled):
161
167
162
- ruff .
168
+ python3 runtests.py lint
163
169
164
170
You can also run all of the above tests using ` runtests.py ` (this includes
165
171
type checking mypy and linting):
Original file line number Diff line number Diff line change 4
4
-r mypy-requirements.txt
5
5
-r build-requirements.txt
6
6
attrs>=18.0
7
- black==24.8.0 # must match version in .pre-commit-config.yaml
8
7
filelock>=3.3.0
9
8
# lxml 4.9.3 switched to manylinux_2_28, the wheel builder still uses manylinux2014
10
9
lxml>=4.9.1,<4.9.3; (python_version<'3.11' or sys_platform!='win32') and python_version<'3.12'
11
10
psutil>=4.0
12
11
pytest>=8.1.0
13
12
pytest-xdist>=1.34.0
14
13
pytest-cov>=2.10.0
15
- ruff==0.6.9 # must match version in .pre-commit-config.yaml
16
14
setuptools>=75.1.0
17
15
tomli>=1.1.0 # needed even on py311+ so the self check passes with --python-version 3.8
18
16
pre_commit>=3.5.0
Original file line number Diff line number Diff line change 6
6
#
7
7
attrs==24.2.0
8
8
# via -r test-requirements.in
9
- black==24.8.0
10
- # via -r test-requirements.in
11
9
cfgv==3.4.0
12
10
# via pre-commit
13
- click==8.1.7
14
- # via black
15
11
coverage==7.6.1
16
12
# via pytest-cov
17
13
distlib==0.3.9
@@ -29,21 +25,13 @@ iniconfig==2.0.0
29
25
lxml==4.9.2 ; (python_version < "3.11" or sys_platform != "win32") and python_version < "3.12"
30
26
# via -r test-requirements.in
31
27
mypy-extensions==1.0.0
32
- # via
33
- # -r mypy-requirements.txt
34
- # black
28
+ # via -r mypy-requirements.txt
35
29
nodeenv==1.9.1
36
30
# via pre-commit
37
31
packaging==24.1
38
- # via
39
- # black
40
- # pytest
41
- pathspec==0.12.1
42
- # via black
32
+ # via pytest
43
33
platformdirs==4.3.6
44
- # via
45
- # black
46
- # virtualenv
34
+ # via virtualenv
47
35
pluggy==1.5.0
48
36
# via pytest
49
37
pre-commit==3.5.0
@@ -61,8 +49,6 @@ pytest-xdist==3.6.1
61
49
# via -r test-requirements.in
62
50
pyyaml==6.0.2
63
51
# via pre-commit
64
- ruff==0.6.9
65
- # via -r test-requirements.in
66
52
tomli==2.0.2
67
53
# via -r test-requirements.in
68
54
types-psutil==6.0.0.20241011
You can’t perform that action at this time.
0 commit comments