Skip to content

Commit f104838

Browse files
committed
Move mypy config to pyproject.toml
1 parent bf5fdd4 commit f104838

File tree

2 files changed

+33
-25
lines changed

2 files changed

+33
-25
lines changed

pyproject.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,36 @@ max-args = 15 # default is 5
207207
max-branches = 28 # default is 12
208208
max-returns = 13 # default is 6
209209
max-statements = 134 # default is 50
210+
211+
######################################################################################
212+
# mypy
213+
#
214+
215+
[tool.mypy]
216+
mypy_path = "$MYPY_CONFIG_FILE_DIR/src"
217+
strict = true
218+
no_implicit_reexport = false
219+
allow_subclassing_any = true
220+
allow_untyped_calls = true
221+
warn_return_any = false
222+
ignore_missing_imports = true
223+
224+
[[tool.mypy.overrides]]
225+
module = "pip._internal.utils._jaraco_text"
226+
ignore_errors = true
227+
228+
[[tool.mypy.overrides]]
229+
module = "pip._vendor.*"
230+
ignore_errors = true
231+
232+
# These vendored libraries use runtime magic to populate things and don't sit
233+
# well with static typing out of the box. Eventually we should provide correct
234+
# typing information for their public interface and remove these configs.
235+
236+
[[tool.mypy.overrides]]
237+
module = "pip._vendor.pkg_resources"
238+
follow_imports = "skip"
239+
240+
[[tool.mypy.overrides]]
241+
module = "pip._vendor.requests.*"
242+
follow_imports = "skip"

setup.cfg

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
[mypy]
2-
mypy_path = $MYPY_CONFIG_FILE_DIR/src
3-
4-
strict = True
5-
6-
no_implicit_reexport = False
7-
allow_subclassing_any = True
8-
allow_untyped_calls = True
9-
warn_return_any = False
10-
ignore_missing_imports = True
11-
12-
[mypy-pip._internal.utils._jaraco_text]
13-
ignore_errors = True
14-
15-
[mypy-pip._vendor.*]
16-
ignore_errors = True
17-
18-
# These vendored libraries use runtime magic to populate things and don't sit
19-
# well with static typing out of the box. Eventually we should provide correct
20-
# typing information for their public interface and remove these configs.
21-
[mypy-pip._vendor.pkg_resources]
22-
follow_imports = skip
23-
[mypy-pip._vendor.requests.*]
24-
follow_imports = skip
25-
261
[tool:pytest]
272
addopts = --ignore src/pip/_vendor --ignore tests/tests_cache -r aR --color=yes
283
xfail_strict = True

0 commit comments

Comments
 (0)