Open maximlt opened 1 year ago
Hi @maximlt,
This is a very reasonable feature request that actually shouldn't be too hard to implement. To do this, we really just need to figure out which configuration file we need to edit. That's exactly what this code here does:
https://github.com/conda/conda/blob/main/conda/cli/main_config.py#L223-L233
The good thing is that we are already have the functions to determine if a particular environment exists.
On top of of -n/--name
, I would also recommend that we add -p/--prefix
to stay consistent with the rest of the commands.
As a temporary work around, you could implement something like this:
# Do this from the base environment
export MY_ENV_NAME='my-cool-env'
conda config --append channels cool-new-channel --file "$CONDA_PREFIX/envs/$MY_ENV_NAME/.condarc"
This will effectively do the same thing granted you are running this from a base environment.
Can I Take This Issue ?
@bleakprestiger sure!
is anyone working on this issue rn? if not I would like to contribute
Hi @harivamsi9 and @bleakprestiger,
Are either of you still interested in working on this (sorry for the very late response 🙃). I'd be happy to assign either of you to it. Just tag me in your response so I don't miss it.
Hi there, thank you for your contribution!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.
If you would like this issue to remain open please:
NOTE: If this issue was closed prematurely, please leave a comment.
Thanks!
Not stale.
Checklist
What is the idea?
conda config
can be used to configure an activated environment withconda config --env ...
. I believe this is a cool feature of conda. However, as I said the environment needs to be activated which poses some problem, I think, when conda is controlled programmatically through its command-line interface as you need to fiddle with the shell (I'd be happy to be proven wrong on this point!).Adding
--name/-n
toconda config
means that it would no longer be required to activate the environment to configure it. It would also make conda's CLI more consistent, as--name/-n
is an option ofconda create/install/update/remove(and more?)
.Why is this needed?
The HoloViz group has a developer tool called
pyctdev
that is meant to be a unified interface for managing a Python project (e.g.doit test_unit
,doit build_package
,doit build_docs
, ...). The user can either choose conda or pip as their dependency manager, i.e.pyctdev
knows how to parse and convert the dependencies listed in a setup.py file so that they can be installed with conda. We're trying to see how we can improve this tool and being able to configure an environment without activating it would be a cool feature.What should happen?
No response
Additional Context
I tried to look for related issues but looking for
conda config
just returns hundred of issues, sorry if this is a duplicate!