python / python/mypy

Duplicate module silently replaces existing module in dmypy recheck --update

Aperta
#6,653 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug priority-0-high topic-daemon topic-fine-grained-incremental
Lingua principale
Python
Stelle
20.6k
Fork
3.3k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

If one has these two files:

# [file a/mod.py]
# empty

# [file b/mod.py]
42 + 'no'

and there are no __init__.py[i] files in the directories, then running dmypy produces the following result:

$ dmypy start -- --follow-import=skip
Daemon started
$ dmypy check a/mod.py 
$ dmypy recheck --update b/mod.py
b/mod.py:1: error: Unsupported operand types for + ("int" and "str")
$ dmypy recheck --remove b/mod.py
b/mod.py:1: error: Unsupported operand types for + ("int" and "str")
$ dmypy recheck --update a/mod.py
b/mod.py:1: error: Unsupported operand types for + ("int" and "str")

The problem here is twofold:

  • When we first trying to add the duplicate module, this should cause a blocking error, as in normal/incremental run instead of silently replacing the other module.
  • Even after one tries to remove the problematic module, it stays in build causing errors in all subsequent runs independently of what is done (except just stopping the daemon).

This is high priority because it causes troubles when adding files in existing large codebases.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci la sequenza con dmypy start, check, recheck --update, recheck --remove e recheck --update usando i due file mod.py duplicati. Traccia il modo in cui il daemon gestisce i moduli duplicati durante l’aggiornamento e la rimozione. Il lavoro è completato quando l’aggiunta del duplicato segnala un errore bloccante, la sua rimozione elimina il modulo obsoleto e le verifiche successive non segnalano più il relativo errore.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.