From 54af37d2227469c6abcf8f3ad20cc7bdd15b3f8b Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 30 Jul 2024 14:17:19 -0400 Subject: [PATCH 1/5] Update mypy.ini from setuptools --- mypy.ini | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/mypy.ini b/mypy.ini index b6f97276..fa231251 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,33 @@ [mypy] -ignore_missing_imports = True -# required to support namespace packages -# https://github.com/python/mypy/issues/14057 +# Set this to True if your project is well-typed +strict = False + +# Settings that are enabled by default with `strict = True`, but we still want with `strict = False` +warn_unused_ignores = True +warn_redundant_casts = True +enable_error_code = ignore-without-code + +# required to support namespace packages: https://github.com/python/mypy/issues/14057 explicit_package_bases = True +# Too many false-positives +disable_error_code = overload-overlap + +exclude = (?x)( + # from skeleton + ^build/ + | ^.tox/ + # end from skeleton + ) + +# - distutils._modified has different errors on Python 3.8 [import-untyped], on Python 3.9+ [import-not-found] +# - All jaraco modules are still untyped +# - wheel appears to be untyped +[mypy-distutils._modified,jaraco.*,wheel.*] +ignore_missing_imports = True + +# Even when excluding a module, import issues can show up due to following import +# https://github.com/python/mypy/issues/11936#issuecomment-1466764006 +# Add your excluded modules that still produce import errors here +# [mypy-a_module.*] +# follow_imports = silent +# silent => ignore errors when following imports From 6e5a7dc8964c0a77483330aee4bf0592f5d69197 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 8 Aug 2024 17:25:28 -0400 Subject: [PATCH 2/5] Tweak comments Avoiding first and second person. --- mypy.ini | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mypy.ini b/mypy.ini index fa231251..cc83d564 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,22 +1,24 @@ [mypy] -# Set this to True if your project is well-typed +# Is the project well-typed? strict = False -# Settings that are enabled by default with `strict = True`, but we still want with `strict = False` +# Early opt-in even when strict = False warn_unused_ignores = True warn_redundant_casts = True enable_error_code = ignore-without-code -# required to support namespace packages: https://github.com/python/mypy/issues/14057 +# Support namespace packages per https://github.com/python/mypy/issues/14057 explicit_package_bases = True -# Too many false-positives + +# Disable overload-overlap due to many false-positives disable_error_code = overload-overlap exclude = (?x)( - # from skeleton + # upstream ^build/ | ^.tox/ - # end from skeleton + + # local ) # - distutils._modified has different errors on Python 3.8 [import-untyped], on Python 3.9+ [import-not-found] From 2ad3661b90ed29d2a434418a8f820a782eb0b25a Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 9 Aug 2024 15:46:20 -0400 Subject: [PATCH 3/5] Update mypy.ini --- mypy.ini | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mypy.ini b/mypy.ini index cc83d564..401dde2c 100644 --- a/mypy.ini +++ b/mypy.ini @@ -21,10 +21,9 @@ exclude = (?x)( # local ) -# - distutils._modified has different errors on Python 3.8 [import-untyped], on Python 3.9+ [import-not-found] -# - All jaraco modules are still untyped -# - wheel appears to be untyped -[mypy-distutils._modified,jaraco.*,wheel.*] +# - most jaraco packages aren't marked as typed +# - wheel is not marked as typed +[mypy-jaraco.*,wheel.*] ignore_missing_imports = True # Even when excluding a module, import issues can show up due to following import From c518c58cc3d38bc8edaf8177a66aefda358d71ca Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 9 Aug 2024 15:52:01 -0400 Subject: [PATCH 4/5] Remove `follow_imports = silent` section --- mypy.ini | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mypy.ini b/mypy.ini index 401dde2c..72f98bdf 100644 --- a/mypy.ini +++ b/mypy.ini @@ -26,9 +26,3 @@ exclude = (?x)( [mypy-jaraco.*,wheel.*] ignore_missing_imports = True -# Even when excluding a module, import issues can show up due to following import -# https://github.com/python/mypy/issues/11936#issuecomment-1466764006 -# Add your excluded modules that still produce import errors here -# [mypy-a_module.*] -# follow_imports = silent -# silent => ignore errors when following imports From ae9fdc20ae3edfd7ef362d943c870e1fefc5ff8b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 12 Aug 2024 12:10:51 -0400 Subject: [PATCH 5/5] Remove over-eager excludes and overmatching jaraco and wheel directives. --- mypy.ini | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/mypy.ini b/mypy.ini index 72f98bdf..83b0d15c 100644 --- a/mypy.ini +++ b/mypy.ini @@ -12,17 +12,3 @@ explicit_package_bases = True # Disable overload-overlap due to many false-positives disable_error_code = overload-overlap - -exclude = (?x)( - # upstream - ^build/ - | ^.tox/ - - # local - ) - -# - most jaraco packages aren't marked as typed -# - wheel is not marked as typed -[mypy-jaraco.*,wheel.*] -ignore_missing_imports = True -