importing google.cloud.logging causes untyped modules in the namespace to be considered missing
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
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 d326952f88214b36d302c7fcbc92320b3c68fa18
- 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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der gemeldeten mypy-Konfiguration und den foo.py-Importen, die den Fehler reproduzieren, und untersuche dann, wie mypy google.cloud-Namespace-Importe behandelt, wenn ignore_missing_imports aktiviert ist. Führe mypy mit und ohne den Import google.cloud.logging auf dem Reproduzierer aus. Fertig bedeutet, dass das Importieren von google.cloud.logging nicht mehr dazu führt, dass google.cloud.bigquery als fehlend gemeldet wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100