Make mypy ignore errors related to an installed external package

  Kiến thức lập trình

I have an installed package foo which is defined as typed (has the py.typed file) but the types are incomplete leading to the error:

bar.py:6: error: Module "foo" has no attribute "Communication"  [attr-defined]
other_bar.py:6: error: Module "foo" has no attribute "Calibration"  [attr-defined]
[...]

I would like to completely ignore the analysis of the package foo to no longer have these errors, as if the package was missing

I have tried to add in pyproject.toml

[[tool.mypy.overrides]]
module = ["foo", "foo.*"]
ignore_errors = "True"

but it does nothing. My understanding is that on mypy’s side, the errors come from bar and other_bar module so the override does nothing.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT