Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Aug 10, 2023
1 parent 07cfe7b commit 927333d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
from mypy.renaming import LimitedVariableRenameVisitor, VariableRenameVisitor
from mypy.stats import dump_type_stats
from mypy.stubinfo import (
is_legacy_bundled_package,
legacy_bundled_packages,
non_bundled_packages,
stub_distribution_name,
Expand Down Expand Up @@ -2672,7 +2671,10 @@ def find_module_and_diagnose(
# negatives. (Unless there are stubs but they are incomplete.)
global_ignore_missing_imports = manager.options.ignore_missing_imports
if (
any(".".join(id_components[:i]) in legacy_bundled_packages for i in range(len(id_components), 0, -1))
any(
".".join(id_components[:i]) in legacy_bundled_packages
for i in range(len(id_components), 0, -1)
)
and global_ignore_missing_imports
and not options.ignore_missing_imports_per_module
and result is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
Expand Down
6 changes: 4 additions & 2 deletions test-data/unit/check-modules.test
Original file line number Diff line number Diff line change
Expand Up @@ -3138,9 +3138,11 @@ import bleach.xyz
from bleach.abc import fgh
[file bleach/__init__.pyi]
[out]
main:1: error: Cannot find implementation or library stub for module named "bleach.xyz"
main:1: error: Library stubs not installed for "bleach.xyz"
main:1: note: Hint: "python3 -m pip install types-bleach"
main:1: note: (or run "mypy --install-types" to install all missing stub packages)
main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
main:2: error: Cannot find implementation or library stub for module named "bleach.abc"
main:2: error: Library stubs not installed for "bleach.abc"

[case testMissingSubmoduleOfInstalledStubPackageIgnored]
# flags: --ignore-missing-imports
Expand Down

0 comments on commit 927333d

Please sign in to comment.