Make cache more agnostic to venvs
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
I noticed that the mypy cache will mark almost everything as stale if the cache was produced with a venv different from the one running mypy. I think this is due to a full path being placed into cache files & interface_hashes, for files that are stdlib or packages. Then those packages, and everything depending on them, gets invalidated (which ends up being 99% of everything in big projects). I think it would be cool if the cache were more agnostic to this, for two reasons:
- when testing locally, I occasionally use a second venv with maybe 1 or 2 different packages to test out changes (maybe a package upgraded or added types). Ideally only those packages and their descendants would be invalidated.
- when trying out remote caches, the CI venv will be "different" (existing at a different path), but the lockfile will be exactly the same. Ideally nothing would be invalidated.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando il modo in cui mypy scrive e confronta i file di cache e gli interface_hashes, soprattutto nei punti in cui vengono registrati i percorsi completi degli ambienti virtuali. Riproduci l’invalidazione con due percorsi venv e confronta il comportamento della cache. Il lavoro è completato quando ambienti equivalenti con percorsi diversi evitano un’invalidazione estesa, mentre i pacchetti modificati e i relativi discendenti continuano a diventare obsoleti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100