Skip to content

importing google.cloud.logging causes untyped modules in the namespace to be considered missing #10360

Open
@graingert

Description

@graingert

Bug Report

To Reproduce

with the mypy config:

[mypy]

[mypy-google.cloud.*]
ignore_missing_imports=true

and the .py file:

from google.cloud import bigquery
from google.cloud import logging

Actual Behavior

I get

foo.py:1: error: Module "google.cloud" has no attribute "bigquery"

however if I comment out:

from google.cloud import bigquery
# from google.cloud import logging

I get

Success: no issues found in 1 source file

Expected Behavior

I don't expect importing a module in a namespace with stubs to affect other modules in that namespace

(Write what happened.)

Your Environment

  • Mypy version used: 0.812 and d326952
  • Mypy command-line flags: mypy.
  • Mypy configuration options from mypy.ini (and other config files): see above
  • Python version used: Python 3.8.5 (default, Jan 27 2021, 15:41:15)
  • Operating system and version: Ubuntu 20.04.2 LTS

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions