python / python/mypy

ignore_missing_imports removed from mypy.ini not noticed due to cache.

Offen
#8,753 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug priority-1-normal
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

  • Are you reporting a bug, or opening a feature request?

bug

  • Please insert below the code you are checking with mypy,
    or a mock-up repro if the source is private. We would appreciate
    if you try to simplify your case to a minimal repro.
$ cat >test.py <<__EOF__
import foobarxyz
__EOF__

$ cat >mypy.ini <<__EOF__
[mypy]
[mypy-foobarxyz]
ignore_missing_imports = True
__EOF__

$ mypy test.py
--> passes typecheck - GOOD

$ cat >mypy.ini <<__EOF__
[mypy]
__EOF__

$ mypy test.py
--> passes typecheck - BAD (*)

$ rm -R .mypy_cache
$ mypy test.py
--> fails typecheck - GOOD
  • What is the actual behavior/output?
    In (*), the file passes typecheck even if we removed ignore_missing_imports from config, which should result in an unresolved import.

  • What is the behavior/output you expect?
    A failed typecheck - the result with cache should be the same as without.

  • What are the versions of mypy and Python you are using?
    0.770

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Verhalten mit den Befehlen test.py und mypy.ini des Issues und vergleiche dann den Lauf mit dem Cache mit dem Lauf nach dem Entfernen von .mypy_cache. Verfolge, wie sich Konfigurationsänderungen auf den Cache auswirken, und überprüfe, dass das Entfernen von ignore_missing_imports dasselbe Ergebnis für nicht aufgelöste Importe mit und ohne vorhandenen Cache erzeugt.

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
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.