Skip to content

Mypy: Don't ignore missing imports (remove ignore_missing_imports) #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[mypy]
allow_redefinition = true
check_untyped_defs = true
ignore_missing_imports = true
incremental = true
strict_optional = true
show_traceback = true
Expand All @@ -11,7 +10,7 @@ warn_unused_configs = true
warn_unreachable = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disable_error_code = empty-body
disable_error_code = empty-body,import-untyped
# TODO: update our test error messages to match new mypy output
show_error_codes = false
force_uppercase_builtins = true
Expand Down
2 changes: 1 addition & 1 deletion rest_framework-stubs/compat.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ try:
except ImportError:
yaml: TypeAlias = None # type: ignore[no-redef]
try:
import inflection
import inflection # type: ignore[import-not-found,unused-ignore]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we don't do anything with inflection, only re-export it via rest_framework.compat, it seems unnecessary to add it even as an optional dependency.

except ImportError:
inflection: TypeAlias = None # type: ignore[no-redef]
try:
Expand Down
Loading