ENH: consistent reporting and exit codes for pytensor-cache clear and unlock

Open
#2,534 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
cli

Research direction

Read the implementations of the clear, unlock, and cleanup commands, along with issue #2531 for the stderr reporting convention. Trace how each command determines what it changed and whether files remain; done means consistent outcome reports and exit codes that indicate partial failure. The issue does not name specific files or tests, so first locate the command entry points and their existing tests.

Written by the indexing model from the issue text.

Description

Description

Observed behavior across the mutating commands:

  • clear prints nothing on success; it warns only when tmp* entries remain.
  • unlock prints "Lock successfully removed!" even when no lock existed (verified: exit 0).
  • clear and cleanup exit 0 even when delete_if_problem=True leaves files behind.

So some commands report their outcome and some do not, and the exit code does not distinguish full success from partial success.

Proposal

Make outcome reporting consistent across commands:

  • Every command reports what it did in the same style: action taken, count/bytes where applicable.
  • unlock: distinguish "no lock found" from "removed stale lock".
  • Exit codes reflect the outcome: nonzero on partial failure.

Reporting goes to stderr per #2531; data summaries on stdout.

Dominant language
Python
Stars
655
Forks
266
Avg merge
3d 23h
Merged PRs (30d)
43

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pymc-devs/pytensor

All issues in pymc-devs/pytensor

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.