uv.lock: a dependency edge with a wrong-typed field crashes instead of exiting 2

Aperta Adatta ai principianti
#258 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
cli, testing

Direzione di ricerca

Leggi _check_field_types in src/wheelgap/sources.py e i test delle sorgenti in tests/test_sources.py. Estendi i controlli sugli archi delle dipendenze di uv.lock ed esegui i test pertinenti. Il lavoro è completato quando i campi degli archi marker, version e name di tipo errato producono ciascuno un SourceError che indica un file e un pacchetto, e il programma termina con codice 2.

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

Descrizione

bug good first issue

#247 made wrong-typed package fields in every lockfile an input error (exit 2, FILE: package a has a version that isn't a string). It doesn't check uv.lock's dependency edges, so this still crashes with a TypeError traceback from packaging:

[[package]]
name = "a"
version = "1.0"
dependencies = [{ name = "b", marker = 5 }]

What to do

  • In src/wheelgap/sources.py, extend the type check _check_field_types (or the uv.lock parser) to the dependencies, optional-dependencies and dev-dependencies edges: name, marker, version and extra must be strings (or lists of strings where uv writes lists).
  • A wrong type is a SourceError naming the file and the package, like the existing check.
  • Tests in tests/test_sources.py: an int marker, a list version and a dict name on an edge each exit 2 with that message.
Lingua principale
Python
Stelle
0
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

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.

Altre issue di patrickballard/wheelgap

Tutte le issue di patrickballard/wheelgap

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.