Allow --rm to remove a virtualenv by its dependencies#455
Open
gilgamezh wants to merge 1 commit into
Open
Conversation
'--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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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