From 1d2b5828d3fa4e2cce3d194776bab0ba742e908b Mon Sep 17 00:00:00 2001 From: Saurav Maheshkar Date: Thu, 30 Mar 2023 16:52:49 +0100 Subject: [PATCH 1/5] chore: move coverage configuration to pyproject --- .coveragerc | 9 --------- pyproject.toml | 11 +++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 .coveragerc 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/pyproject.toml b/pyproject.toml index 435626ac8f4..cd722bb14e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -215,3 +215,14 @@ 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 From b81ff736dc0597efe1642dc69b09e0befe32bd80 Mon Sep 17 00:00:00 2001 From: Saurav Maheshkar Date: Thu, 30 Mar 2023 16:57:10 +0100 Subject: [PATCH 2/5] chore: move mypy configuration to pyproject --- mypy.ini | 41 ----------------------------------------- pyproject.toml | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 41 deletions(-) delete mode 100644 mypy.ini 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 cd722bb14e8..467c750a019 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -226,3 +226,24 @@ omit = [ [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 From e795b9738c15e07680b67f2938f9adffdf8ef411 Mon Sep 17 00:00:00 2001 From: Saurav Maheshkar Date: Thu, 30 Mar 2023 17:03:01 +0100 Subject: [PATCH 3/5] fix: update mypy module overrides --- pyproject.toml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 467c750a019..b3285965a09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -237,13 +237,29 @@ no_implicit_reexport = true warn_unreachable = true [[tool.mypy.overrides]] -module = [ - "blib2to3.driver.*", - "IPython.*", - "colorama.*", - "pathspec.*", - "tokenize_rt.*", - "uvloop.*", - "_black_version.*" -] +module="blib2to3.driver.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module="IPython.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module="colorama.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module="pathspec.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module="tokenize_rt.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module="uvloop.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module="_black_version.*" ignore_missing_imports = true From 5d37651aed8a7d04ad2fc65ae4941768e79b6818 Mon Sep 17 00:00:00 2001 From: Saurav Maheshkar Date: Thu, 30 Mar 2023 17:11:43 +0100 Subject: [PATCH 4/5] chore: specify config in pre-commit config --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) 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 From 52dbc57f542e6aff419c4c22143fdbdfd040eaa8 Mon Sep 17 00:00:00 2001 From: Saurav Maheshkar Date: Mon, 3 Apr 2023 04:14:37 +0530 Subject: [PATCH 5/5] style(build): update mypy ignores --- pyproject.toml | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b3285965a09..b63156efb3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -237,29 +237,13 @@ no_implicit_reexport = true warn_unreachable = true [[tool.mypy.overrides]] -module="blib2to3.driver.*" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module="IPython.*" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module="colorama.*" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module="pathspec.*" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module="tokenize_rt.*" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module="uvloop.*" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module="_black_version.*" +module = [ + "blib2to3.driver.*", + "IPython.*", + "colorama.*", + "pathspec.*", + "tokenize_rt.*", + "uvloop.*", + "_black_version.*" +] ignore_missing_imports = true