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

conda config --add channels is not what it says it is #4452

Closed
basnijholt opened this issue Jan 27, 2017 · 10 comments
Closed

conda config --add channels is not what it says it is #4452

basnijholt opened this issue Jan 27, 2017 · 10 comments
Labels
good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward locked [bot] locked due to inactivity source::community catch-all for issues filed by community members stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity type::feature request for a new feature or capability

Comments

@basnijholt
Copy link
Contributor

adding multiple channels doesn't work, so the name should be:
conda config --add channel

@bsipocz
Copy link

bsipocz commented Jan 31, 2017

@basnijholt - in my reading in the configuration there is a key channels, so it should be indeed used as channels in the command above. It's unfortunate that currently it's not possible to add multiple values for a given key.
However it's a useful feature request I think.

@kalefranz kalefranz added source::community catch-all for issues filed by community members type::feature request for a new feature or capability labels May 5, 2017
@kalefranz kalefranz added the good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward label Mar 2, 2018
@kalefranz
Copy link
Contributor

It's unfortunate that currently it's not possible to add multiple values for a given key.

Implementing that capability would be a good first issue for a new contributor.

@marcelotrevisani
Copy link
Member

Today after work I will try to add that

jdhalimi added a commit to jdhalimi/conda that referenced this issue May 3, 2018
@jdhalimi
Copy link

jdhalimi commented May 3, 2018

Hello, I tried an implementation here and it seems to support both

conda config --add channels conda-canary
conda config --add channel conda-canary

@mbargull
Copy link
Member

mbargull commented May 7, 2018

Thanks for taking a look at this @jdhalimi. To retain the one-to-one mapping of configuration parameters from conda config and .condarc, I think we don't necessarily want to enable/translate conda config --add channel conda-canary. Rather, we should just allow the currently supported

conda config --add channels defaults --add channels conda-canary

to be optionally be given as

conda config --add channels conda-canary defaults

. This likely just requires nargs=2 to be changed to nargs='+' at
https://github.com/conda/conda/blob/4.6.0a2/conda/cli/conda_argparse.py#L446
https://github.com/conda/conda/blob/4.6.0a2/conda/cli/conda_argparse.py#L454
https://github.com/conda/conda/blob/4.6.0a2/conda/cli/conda_argparse.py#L470
and loop over the those multiple values accordingly at
https://github.com/conda/conda/blob/4.6.0a2/conda/cli/main_config.py#L281
https://github.com/conda/conda/blob/4.6.0a2/conda/cli/main_config.py#L317
.

@mbargull
Copy link
Member

mbargull commented May 7, 2018

Note that for --add (which is an alias for --prepend)

conda config --add channels defaults --add channels conda-canary

translates to

conda config --add channels defaults
conda config --add channels conda-canary

and thus to

channels:
  - conda-canary
  - defaults

. When supporting nargs='+', the reverse order, i.e.,

conda config --add channels conda-canary defaults

would be more natural. Hence, you'd need to take care of this change of order when expanding the loop at
https://github.com/conda/conda/blob/4.6.0a2/conda/cli/main_config.py#L281
.

@jdhalimi
Copy link

jdhalimi commented May 7, 2018

hello @mbargull,

thank you for having a look at this change, I was training my github skills with a "good first issue"
I didn't expect you would spend time on it as I didn't post a pull request.

I strongly agree that changing conda config is not a big improvement and will involve regressions for users that uses it already.

I read your suggestions for handling multiple channels in one call. I also prefer this approach (even if it is almost equivalent to multiple calls to --add channels).

I will try to submit an implementation in my repo as soon as I have a piece of time.

Thanks again,
Jean-David.

@mbargull
Copy link
Member

mbargull commented May 7, 2018

I will try to submit an implementation in my repo as soon as I have a piece of time.

Great, thanks!

@kalefranz
Copy link
Contributor

kalefranz commented May 7, 2018

In my comment above, I think what I had in mind was

conda config --add channels conda-forge --prepend channels conda-canary --set path_conflict warn

@github-actions
Copy link

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:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label May 14, 2022
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Jun 14, 2022
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Jun 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward locked [bot] locked due to inactivity source::community catch-all for issues filed by community members stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity type::feature request for a new feature or capability
Projects
None yet
Development

No branches or pull requests

6 participants