Add --yes support to self remove and self update subcommands#108
Merged
Conversation
`conda self remove` hardcoded `yes=False` when spawning `conda remove` in a subprocess, causing an interactive confirmation prompt that hangs in non-interactive contexts (tests, CI with a tty, etc.). Fix by adding `add_output_and_prompt_options` to both `self remove` and `self update` parsers, which registers `--yes`, `--dry-run`, `--json`, and `--quiet` flags consistently with other subcommands like `self reset`. For `self remove`, the confirmation is now handled in-process via `confirm_yn()` (matching the `self reset` pattern), and the subprocess always runs with `--yes` once the user has confirmed. For `self update`, the duplicate `--dry-run` argument is removed (now provided by `add_output_and_prompt_options`) and `context.always_yes` is passed through to `install_package_list_in_protected_env`.
--yes support to self remove and self update subcommands
Member
Author
|
Merging this myself since it's blocking the tests locally right now |
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.
Summary
Fixes #107.
conda self remove: Was hardcodingyes=Falsewhen spawningconda remove, causing an interactive prompt that hangs in non-interactive contexts. Now usesconfirm_yn()in-process (matching theself resetpattern), then always passes--yesto the subprocess.conda self update:install_package_list_in_protected_envranconda installwithout--yes. Now accepts and passes throughcontext.always_yes. Also removed a duplicate--dry-runflag that would conflict with the one fromadd_output_and_prompt_options.add_output_and_prompt_optionsconsistently, gaining--yes,--dry-run,--json, and--quietflags.Test plan
test_remove_protected_plugin— protected specs still raiseSpecsCanNotBeRemovedtest_remove_unprotected_plugin_passes_validation— non-protected specs pass validation with--yestest_remove_nonessential_plugin— end-to-end remove in a tmp env (previously hung locally)test_update_conda/test_update_plugin/test_update_all— update tests still pass with--dry-runtest_reset_migrate— reset test usingself update --yesno longer hangs