diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 5577e496a57..00000000000 --- a/.coveragerc +++ /dev/null @@ -1,9 +0,0 @@ -[report] -omit = - src/blib2to3/* - tests/data/* - */site-packages/* - .tox/* - -[run] -relative_files = True diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a69fb645238..f253333704c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,6 +42,7 @@ repos: hooks: - id: mypy exclude: ^docs/conf.py + args: ["--config", "pyproject.toml"] additional_dependencies: - types-dataclasses >= 0.1.3 - types-PyYAML diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 58bb7536173..00000000000 --- a/mypy.ini +++ /dev/null @@ -1,41 +0,0 @@ -[mypy] -# Specify the target platform details in config, so your developers are -# free to run mypy on Windows, Linux, or macOS and get consistent -# results. -python_version=3.7 - -mypy_path=src - -show_column_numbers=True -show_error_codes=True - -# be strict -strict=True - -# except for... -no_implicit_reexport = False - -# Unreachable blocks have been an issue when compiling mypyc, let's try -# to avoid 'em in the first place. -warn_unreachable=True - -[mypy-blib2to3.driver.*] -ignore_missing_imports = True - -[mypy-IPython.*] -ignore_missing_imports = True - -[mypy-colorama.*] -ignore_missing_imports = True - -[mypy-pathspec.*] -ignore_missing_imports = True - -[mypy-tokenize_rt.*] -ignore_missing_imports = True - -[mypy-uvloop.*] -ignore_missing_imports = True - -[mypy-_black_version.*] -ignore_missing_imports = True diff --git a/pyproject.toml b/pyproject.toml index 435626ac8f4..b63156efb3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -215,3 +215,35 @@ filterwarnings = [ # https://github.com/aio-libs/aiohttp/issues/6905 '''ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning''', ] + +[tool.coverage.report] +omit = [ + "src/blib2to3/*", + "tests/data/*", + "*/site-packages/*", + ".tox/*" +] + +[tool.coverage.run] +relative_files = true + +[tool.mypy] +python_version = "3.7" +mypy_path = "src" +show_column_numbers = true +show_error_codes = true +strict = true +no_implicit_reexport = true +warn_unreachable = true + +[[tool.mypy.overrides]] +module = [ + "blib2to3.driver.*", + "IPython.*", + "colorama.*", + "pathspec.*", + "tokenize_rt.*", + "uvloop.*", + "_black_version.*" +] +ignore_missing_imports = true