Open jrbourbeau opened 2 years ago
A simple way to remove would be to just do conda config --remove channels defaults
Could also override the condarc
with the channels you want
Hi @jrbourbeau
So we should be using /Users/runner/.condarc
and not miniconda3/.condarc it seems
We will take a look
Ran into this as well in issue ( https://github.com/conda-forge/clangdev-feedstock/issues/166 ), which led to a bit of a confusing linking error
I think I have the same issue, although I did not use an environment file.
I can verify that with this workflow:
name: Setup Miniconda
on:
repository_dispatch:
types:
- setup-miniconda
jobs:
setup:
runs-on: "macos-latest"
name: Setup
defaults:
run:
shell: bash -l {0}
steps:
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "py38_4.8.3"
python-version: "3.8"
channels: conda-forge
# - run: conda config --remove channels defaults
- run: conda config --show channels
- run: cat /Users/runner/.condarc
the defaults channel is still used, and the contents of /Users/runner/.condarc
are:
notify_outdated_conda: false
pkgs_dirs:
- /Users/runner/conda_pkgs_dir
channels:
- conda-forge
- defaults
auto_activate_base: true
auto_update_conda: false
always_yes: true
changeps1: false
Also, using the workaround suggested by @jakirkham works.
Something else worth trying might be adding nodefaults
to the channels
This is interesting behavior of Conda, to always add defaults
unless channels
is already defined:
echo "" > test.condarc
conda config --add channels conda-forge --file test.condarc
cat test.condarc
# channels:
# - conda-forge
# - defaults
echo "channels: []" > test.condarc
conda config --add channels conda-forge --file test.condarc
cat test.condarc
# channels:
# - conda-forge
Something else worth trying might be adding
nodefaults
to thechannels
This is even done in the source code for example 6 (although that's not what's shown on the readme); unfortunately all this does is add - nodefaults
to the channel list:
Log source for image: https://github.com/conda-incubator/setup-miniconda/actions/runs/10551479166/job/29228977318
Although this doesn't seem like what's intended from the example, it is intelligible from the source:
We're using
setup-miniconda
over indask-bigquery
and discovered that when using this environment file which specifies only theconda-forge
channel, along with thisconda-incubator/setup-miniconda
GitHub actions setup, which is using mambaforge and strict channel priority, we still end up with a few packages installed from themain
channel. This channel mixing is, I think, leading to CI errors for the project.If I look at the logs from this CI build
it appears
conda config --show-sources
, which is run duringsetup-miniconda
shows, two separate sources:/Users/runner/miniconda3/.condarc
: which only specifies theconda-forge
channel/Users/runner/.condarc
: which specifies bothconda-forge
anddefaults
So the
defaults
channel is being added at some point, but it's not clear to me where and how I can disable it from being added. Any help is appreciated