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: set channel via keyword #446

Closed
henryiii opened this issue Jun 10, 2021 · 1 comment · Fixed by #522
Closed

conda: set channel via keyword #446

henryiii opened this issue Jun 10, 2021 · 1 comment · Fixed by #522

Comments

@henryiii
Copy link
Collaborator

How would this feature be useful?
Minor addition for a common situation.

Describe the solution you'd like

What about having a channel= keyword argument for conda_install so that one could write channel="conda-forge" if selecting a channel? It would be a bit more natural than "--channel=conda-forge", I think, and likely is very common.

It is possible to set multiple channels - this is required for bioconda, for example. This could be an iterable, channel=["conda-forge", "bioconda"]. Maybe the keyword should be "channels" and always takes a list?

Describe alternatives you've considered

Leave as is.

@FollowTheProcess
Copy link
Collaborator

FollowTheProcess commented Sep 10, 2021

I think this is a good idea, I use conda a little bit and do sometimes run into difficulties with different channels. Having the flexibility to choose per session would be ideal and agree on the --channel inside the function being less natural.

I think this would be fairly easy to implement too as all you'd have to do (I think) is implement the argument here: https://github.com/theacodes/nox/blob/9c696e2bc2e47ec0f2acd322c7e4be941dab0518/nox/sessions.py#L342-L346

Then it effectively just shells out to conda here:
https://github.com/theacodes/nox/blob/9c696e2bc2e47ec0f2acd322c7e4be941dab0518/nox/sessions.py#L403-L412

So as long as conda supports the -c flag to set the channel then this could be easily done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants