ENH: pytensor-cache should support --help/-h and standard CLI expectations

Aperta
#2,530 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
cli

Direzione di ricerca

Find the pytensor-cache entry point and its current sys.argv dispatch; the issue does not name the file or tests. Read how the existing commands are invoked, then run the CLI checks for global and subcommand help, invalid commands, nested basecompiledir commands, and bare invocation. Done means the proposed argparse behavior works while bare invocation still prints the compiledir path with exit 0.

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

Descrizione

Description

The CLI dispatches on len(sys.argv). Verified behavior:

Invocation Result
pytensor-cache --help usage on stdout, exit 1
pytensor-cache -h usage on stdout, exit 1
pytensor-cache clear extra generic usage, exit 1
pytensor-cache basecompiledir bogus generic usage, exit 1

The only way to see usage is the literal subcommand help. Standard flags fail, and every mistake produces the same generic message with no indication of what was wrong.

Proposal

Switch the CLI to argparse subcommands, so the basics come for free:

  • --help / -h globally and per subcommand.
  • Targeted errors for unknown or misspelled subcommands (invalid choice: 'bogus') instead of the generic dump.
  • Subcommands: list, clear, cleanup, purge, unlock, basecompiledir {list,purge}; nested subparsers for basecompiledir.
  • Bare pytensor-cache keeps printing the compiledir path (exit 0). Scripts rely on it.
  • Keep help working as an alias for --help.

No output-format changes in this issue. (A --verbose flag that configures logging could be added later.)

Lingua principale
Python
Stelle
654
Fork
258
Merge medio
2g 7h
PR unite (30g)
39

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 pymc-devs/pytensor

Tutte le issue di pymc-devs/pytensor

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.