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

オープン
#2,530 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
654
フォーク
258
平均マージ
2日 7時間
マージ済み PR(30日)
39

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pymc-devs/pytensor のほかの issue

pymc-devs/pytensor の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。