You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mypy by default silences all errors that come from installed third party packages in site-packages. This can be disabled with the --no-silence-site-packages flag.
However, they are not silenced in pytest-mypy-plugins tests and I don't see a way to enable that behavior.
For example in typeddjango/djangorestframework-stubs#480 I enabled disallow_untyped_defs and disallow_incomplete_defs options, but then I got mypy errors from yaml-stubs package:
_________________________________________________________________________________________________ test_override_get_permissions _________________________________________________________________________________________________
/Users/marti.raudsepp/own/djangorestframework-stubs/tests/typecheck/test_views.yml:69:
E pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected:
E Actual:
E ../../../../../../[...]/djangorestframework-stubs/.venv/lib/python3.11/site-packages/yaml-stubs/__init__.pyi:29: error: Function is missing a type annotation (diff)
E ../../../../../../[...]/djangorestframework-stubs/.venv/lib/python3.11/site-packages/yaml-stubs/__init__.pyi:30: error: Function is missing a return type annotation (diff)
... lots more ...
As a work-around, I can just suppress these in mypy.ini
Mypy by default silences all errors that come from installed third party packages in
site-packages
. This can be disabled with the--no-silence-site-packages
flag.However, they are not silenced in
pytest-mypy-plugins
tests and I don't see a way to enable that behavior.For example in typeddjango/djangorestframework-stubs#480 I enabled
disallow_untyped_defs
anddisallow_incomplete_defs
options, but then I got mypy errors fromyaml-stubs
package:As a work-around, I can just suppress these in
mypy.ini
The text was updated successfully, but these errors were encountered: