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

Install conda packages with --override-channels #103

Open
maximlt opened this issue Nov 30, 2022 · 0 comments
Open

Install conda packages with --override-channels #103

maximlt opened this issue Nov 30, 2022 · 0 comments

Comments

@maximlt
Copy link
Contributor

maximlt commented Nov 30, 2022

I've been adding variations of these commands in many parts of the CI, pretty much every time a conflict appeared using this pattern fixed it:

          conda create -n test-environment
          conda activate test-environment
          conda config --env --append channels pyviz/label/dev --append channels conda-forge
          conda config --env --remove channels defaults
          conda install python=3.8 pyctdev
          doit develop_install ...

The idea was to:

  1. create an empty environment
  2. set the channels of that specific environment with conda config --env ...
  3. install the packages without having to define the channels with -c channel1 -c channel2 ...

It seemed like a nice approach that could have been codified in pyctdev to apply it across the repos. Its advantage would be that as a user of that created environment, locally, if you wanted to install something in that environment you wouldn't have to remember what channels it uses and in which order, as the channels are declared for you. However it has two limitations, mostly coming from conda:

  • tricky to configure(?): conda config has no -n option so it needs to be executed from an activated environment, I believe that running conda activate programmatically has some issues
  • no separation with the global config: the channels declared in the global ~/.condarc file still leak to the environments. For instance, if the global ~/.condarc file list the defaults channel, it is going to be available in the environment.

Instead of going down that route, I suggest that all the conda create/install commands executed by pyctdev:

  • take the whole list of channels
  • use --override-channels

I think that approach would be equivalent for conda to what I was doing above. As a user of that created environment, if you want to change the environment, you'll have to remember the whole list of channels and to use --override-channels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant