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

Đang mở
#2,530 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
58/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
654
Fork
258
Merge trung bình
3 ngày 41 phút
Pull request đã merge (30 ngày)
42

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pymc-devs/pytensor

Tất cả issue của pymc-devs/pytensor

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.