-
Notifications
You must be signed in to change notification settings - Fork 2
Install conda packages with --override-channels #103
Description
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:
- create an empty environment
- set the channels of that specific environment with
conda config --env ... - 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 confighas no-noption so it needs to be executed from an activated environment, I believe that runningconda activateprogrammatically has some issues - no separation with the global config: the channels declared in the global
~/.condarcfile still leak to the environments. For instance, if the global~/.condarcfile 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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status