Bug: `setup.cfg` `install_requires` on the same line as the key is not read

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

I maintainer di solito rispondono entro 1 giorno

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, typescript
Ambito
cli, devtools

Direzione di ricerca

Inizia in src/core-open/scanners/python-scanner.ts, da parseSetupCfg, e leggi come viene riconosciuto install_requires e come ogni voce viene passata a parseRequirementLine. Aggiungi o estendi i test del manifest Python accanto a quelli esistenti, verificando le forme sulla stessa riga, con continuazione e con ritorno a capo seguito da indentazione, e conferma che python_requires resti invariato. Il lavoro è completato quando viene segnalato ogni pacchetto elencato e la forma esistente continua a funzionare.

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

Descrizione

bug good first issue
  • Difficulty: small
  • Area: Python scanner
Problem

parseSetupCfg in src/core-open/scanners/python-scanner.ts (around line 1148) only matches a multiline indented list:

const installReqMatch = optionsSection[1]!.match(/install_requires\s*=\s*\n((?:\s+.*\n?)*)/);

The regex requires a newline after =. These common forms are dropped:

[options]
install_requires = requests>=2.31, flask>=3.0
[options]
install_requires = requests>=2.31
    flask>=3.0

The already-supported form (value starts on the next line, one requirement per indented line) must keep working.

Expected behaviour

install_requires accepts a same-line list (comma-separated or a single requirement), a list that starts on the same line and continues with indented lines, and the current newline-then-indent form. Each entry is parsed with the existing parseRequirementLine helper.

Acceptance
  • Tests live next to other Python manifest tests (for example a new test/python-setup-cfg.test.ts, or cases in test/python-runtime-pin.test.ts).
  • install_requires = requests>=2.31 on one line reports requests.
  • A comma-separated same-line list reports every package.
  • A value that starts on the same line and continues with indented lines reports every package.
  • The current indented-only form still works.
  • python_requires on the same [options] section is unchanged.

Lingua principale
TypeScript
Stelle
4
Fork
3
Merge medio
1g 22h
PR unite (30g)
76

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 vibgrate/cli

Tutte le issue di vibgrate/cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.