Closed liamhuber closed 2 months ago
This is a non-issue, because we already expose the underlying arguments (in case you want to set them yourself), we already override conda-incubator/setup-miniconda
kwargs with our own kwargs in cached-miniconda
, and these are exactly the "safe" ones that are both what we want and the current setup-miniconda
defaults.
Nope, it looks like the mamba update
call still eventually falls back to include defaults
!
Hmm, except the latest cached-miniforge
never explicitly calls mamba update
-- now it's always setup-miniconda
, so there's a possibility this is actually an upstream issue with setup-miniconda
not following through...
Indeed, this is a known issue on conda-incubator/setup-miniconda and even a known gotcha on conda/conda.
One solution is to specify nodefaults
right in your env-file....
channels:
- conda-forge
- nodefaults
dependencies:
...
But this is still sub-optimal IMO.
An alternative option, is to create your own .condarc
using:
echo -e "auto_update_conda: False\nauto_activate_base: True\nnotify_outdated_conda: False\nchangeps1: False\npkgs_dirs:\n - /home/runner/conda_pkgs_dir\nchannels:\n - conda-forge\nalways_yes: True\nsolver: libmamba" > .condarc
then you can include it in the action using:
condarc-file: .condarc
I tested this for the notebooks
test in https://github.com/pyiron/pyiron_atomistics/pull/1545
👍 I find this preferable to having to specify channels: nodefaults
in each env file. It's still ugly compared to specifying the channel right in the setup-miniconda
action and actually having it read that, so I'm working on a patch for the root action there.
The key thing in your solution is channels:\n - conda-forge
, as then the channels field is not initially empty and thus conda doesn't pre-populate it with defaults
. It's possible you can then trim down the rest of the RC file and have setup-miniconda
populate the rest, but I don't know what the interaction is between a provided RC file and the action arguments.
I opened a PR to fix it upstream.
Due to anaconda license terms.
pyiron/actions/cached-miniforge
uses miniforge and strictly uses the conda-forge channel. I'll anyhow update the defaults for these args so we are explicitly requesting theminiforge-channels
andmiiniforge-channel-priority
from our end rather than relying on thesetup-miniconda
defaults being favourable (although it seems unlikely they'll change these).