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

Abierto
#2,530 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
58/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.)

Lenguaje dominante
Python
Estrellas
654
Forks
258
Merge medio
2 d 7 h
PR fusionados (30 d)
39

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pymc-devs/pytensor

Todos los issues de pymc-devs/pytensor

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.