Repository navigation
Conversation
facundobatista
left a comment
There was a problem hiding this comment.
Awesome, thanks! There's a couple of very small details, commented inline...
aea30e1 to
2424e27
Compare
|
One edge case with With
So the natural "remove the venv for this script" ( Proposal: venv UUIDs are always if isinstance(args.remove, str):
try:
uuid.UUID(args.remove)
except ValueError:
# not a UUID: it's the child program, remove by its dependencies
if args.child_program is not None:
args.child_options.insert(0, args.child_program)
args.child_program = args.remove
args.remove = REMOVE_BY_DEPSThat makes If that's too magic, the conservative alternative is to error out on a non-UUID value, suggesting Happy to push either one; I lean towards the first. Generated by Claude Code |
|
Pushed 76b3571 to fix the
Tests: the existing UUID tests now use a real UUID, and I added tests for Generated by Claude Code |
'--rm' now takes an optional UUID: when passed a UUID it removes that virtualenv as before, but when given as a bare flag it removes the virtualenv matching the indicated dependencies (e.g. 'fades --rm -d django'), saving the round-trip through '--where' to look up the UUID. Add tests for the '--rm' flow in go() (by UUID and by dependencies), and update the man page and README accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M8yxMZWHoMvnGE8biuNrGb
As '--rm' takes an optional UUID, argparse grabs the script as its value. Venv UUIDs are always valid UUIDs, so a value that isn't one is taken as the child program, removing the venv by its dependencies. The bare '--rm' value is now an empty string instead of an object() sentinel, so the value is always None or a str. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
76b3571 to
b659f69
Compare
What
--rmnow accepts either a UUID or nothing. When given as a bare flag it removes the virtualenv matching the indicated dependencies, so this:fades --rm $(fades --where -d django | awk -F "/" '{print $NF}')becomes simply:
How
--rmusesnargs='?'with aREMOVE_BY_DEPSsentinel asconst, distinguishing "not passed" / "passed with UUID" / "passed bare".get_venv(indicated_deps, interpreter, options=options)— the same matching used to run a venv — otherwise it uses the existing UUID lookup. Both share the destroy + warning logic.fades --rm <uuid>behaves exactly as before.Tests
There were no tests for the
--rmflow ingo(). AddedRemoveVenvTestCasecovering removal by UUID (found / not found / invalid env_path) and by dependencies (found / not found).Docs
Updated
man/fades.1andREADME.rst(usage synopsis + command examples).🤖 Generated with Claude Code