python / python/mypy

0.800: Unable to configure subdirectories

Offen
#10,045 10 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug topic-configuration
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

In Mypy 0.800, it now checks files in subdirectories without __init__.py files.

The problem is that the config still only works on modules containing __init__.py, meaning there is no way to change the config for these subdirectories.

e.g.
untyped-def errors have started appearing in test/foo/bar.py

Adding this to config has no effect:

[mypy-tests.*]
disallow_untyped_defs = False

This only works if tests/__init__.py and tests/foo/__init__.py are created.

Expected behaviour is that the above config will ignore the errors, or an alternative syntax is available to do so (e.g. [mypy-tests/*].

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 Problem mit tests/foo/bar.py und einer Konfiguration mit [mypy-tests.*] und disallow_untyped_defs = False. Verfolge, wie Konfigurationsabschnitte Unterverzeichnissen ohne init.py-Dateien zugeordnet werden; abgeschlossen ist die Aufgabe, wenn die bestehende Syntax funktioniert oder eine alternative Syntax unterstützt und anhand dieses Beispiels verifiziert 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

Neue Issues direkt in Ihr Postfach

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