Skip to content

Commit 24c3d2b

Browse files
authored
Merge pull request #99 from Z2PackDev/convert_mypy_to_local
Convert mypy to a 'local' hook in pre-commit
2 parents d72ca82 + 9c590d6 commit 24c3d2b

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ repos:
44
hooks:
55
- id: pyupgrade
66
args: [--py36-plus]
7+
78
- repo: https://github.com/psf/black
89
rev: 20.8b1
910
hooks:
1011
- id: black
11-
- repo: https://github.com/pre-commit/mirrors-mypy
12-
rev: v0.782
13-
hooks:
14-
- id: mypy
15-
exclude: "^(doc/)|(examples/)|(playground/)"
12+
1613
- repo: local
1714
hooks:
1815
- id: pylint
@@ -21,6 +18,17 @@ repos:
2118
language: system
2219
types: [python]
2320
exclude: "^(doc/)|(examples/)|(playground/)|(utils/)"
21+
22+
- id: mypy
23+
name: mypy
24+
entry: mypy
25+
language: python
26+
types: [python]
27+
#args: [--scripts-are-modules]
28+
require_serial: true
29+
exclude: "^(doc/)|(examples/)|(playground/)"
30+
args: []
31+
2432
- id: interpolate-workflows
2533
name: Interpolate Github workflows
2634
entry: python ./utils/interpolate_yaml_anchors.py

mypy.ini

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ warn_unreachable = True
2828
allow_untyped_globals = False
2929
strict_equality = True
3030

31+
[mypy-setuptools.*]
32+
ignore_missing_imports = True
33+
3134
[mypy-numpy.*]
3235
ignore_missing_imports = True
3336

@@ -37,9 +40,18 @@ ignore_missing_imports = True
3740
[mypy-h5py.*]
3841
ignore_missing_imports = True
3942

43+
[mypy-ruamel.*]
44+
ignore_missing_imports = True
45+
4046
[mypy-kwant.*]
4147
ignore_missing_imports = True
4248

49+
[mypy-fastentrypoints.*]
50+
ignore_missing_imports = True
51+
52+
[mypy-pythtb.*]
53+
ignore_missing_imports = True
54+
4355
[mypy-fsc.hdf5_io.*]
4456
ignore_missing_imports = True
4557

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ kwant =
4646
kwant
4747
dev =
4848
kwant
49-
pytest>=4.6
49+
pytest~=6.0
5050
pytest-cov
5151
pythtb
5252
sphinx

0 commit comments

Comments
 (0)