Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a manual short-term unlock/lock context manager thing #4

Open
mattkram opened this issue Apr 1, 2024 · 3 comments
Open

Add a manual short-term unlock/lock context manager thing #4

mattkram opened this issue Apr 1, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@mattkram
Copy link

mattkram commented Apr 1, 2024

It would be nice if there was a way to conda install that explicitly un-protects the environment, does the install, then re-protects at the end. In Python, this would use a context manager pattern:

# Pseudocode
with un_protect(env):
  do_install()
# Environment gets `conda protect env`'d after exiting the with block

But at the CLI it might be something like: conda force-install numpy or something. I'm not sure what the best naming would be, but it would help with usability. Ideally the subcommand name is different enough from install that it would be really hard to accidentally use it.

@travishathaway travishathaway added the enhancement New feature or request label May 15, 2024
@travishathaway
Copy link
Collaborator

@mattkram,

I would prefer to nest this underneath the conda protect namespace rather than have it register a separate force-install sub-command. I understand this might make the command itself a little verbose, but it would help keep things organized and give the end user a clear idea of which plugin has registered this command.

Maybe:

conda protect force-install -n <package>

But, wouldn't mirroring the install command open up a can of worms regarding keep the options and help pages in sync? Or do you have an idea for how to deal with this?

@mattkram
Copy link
Author

Is there a way to add a CLI option flag to the relevant conda install, conda update, conda remove commands? I'm thinking like conda install --override-protect or something else?

@travishathaway
Copy link
Collaborator

@mattkram,

That is not possible with the current plugins system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants