Skip to content

Commit

Permalink
Enable option to remove 'defaults' which might be implicitly added to…
Browse files Browse the repository at this point in the history
… conda configuration (#2164)
  • Loading branch information
antonwolfy authored Nov 12, 2024
1 parent 4f12d67 commit 81047fa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 41 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,12 @@ jobs:
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
miniforge-version: latest
use-mamba: true
use-mamba: 'true'
channels: conda-forge
conda-remove-defaults: 'true'
python-version: ${{ env.python-ver }}
activate-environment: 'docs'

# Here is an issue in conda gh-12356 causing adding defaults to the list of channels
# upon running `conda config --append channels conda-forge`, while mamba requires to have only conda-forge channel
- name: Remove defaults channel
run: |
conda config --remove channels defaults
conda config --show
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
- name: Disable speed limit check in mamba
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
Expand Down
36 changes: 11 additions & 25 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,12 @@ jobs:
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
miniforge-version: latest
use-mamba: true
use-mamba: 'true'
channels: conda-forge
conda-remove-defaults: 'true'
python-version: ${{ matrix.python }}
activate-environment: 'build'

# Here is an issue in conda gh-12356 causing adding defaults to the list of channels
# upon running `conda config --append channels conda-forge`, while mamba requires to have only conda-forge channel
- name: Remove defaults channel
run: |
conda config --remove channels defaults
conda config --show
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
- name: Disable speed limit check in mamba
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
Expand Down Expand Up @@ -154,14 +148,12 @@ jobs:
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
miniforge-version: latest
use-mamba: true
use-mamba: 'true'
channels: conda-forge
conda-remove-defaults: 'true'
python-version: ${{ matrix.python }}
activate-environment: ${{ env.TEST_ENV_NAME }}

- name: Remove defaults channel
run: conda config --remove channels defaults

- name: Install conda-index
run: mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}

Expand Down Expand Up @@ -283,14 +275,12 @@ jobs:
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
miniforge-version: latest
use-mamba: true
use-mamba: 'true'
channels: conda-forge
conda-remove-defaults: 'true'
python-version: ${{ matrix.python }}
activate-environment: ${{ env.TEST_ENV_NAME }}

- name: Remove defaults channel
run: conda config --remove channels defaults

- name: Store conda paths as envs
run: |
@echo on
Expand Down Expand Up @@ -428,14 +418,12 @@ jobs:
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
miniforge-version: latest
use-mamba: true
use-mamba: 'true'
channels: conda-forge
conda-remove-defaults: 'true'
python-version: ${{ matrix.python }}
activate-environment: 'upload'

- name: Remove defaults channel
run: conda config --remove channels defaults

- name: Install anaconda-client
run: mamba install anaconda-client

Expand Down Expand Up @@ -467,15 +455,13 @@ jobs:
- uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
miniforge-version: latest
use-mamba: true
use-mamba: 'true'
channels: conda-forge
run-post: false
conda-remove-defaults: 'true'
run-post: 'false'
python-version: '3.12'
activate-environment: 'cleanup'

- name: Remove defaults channel
run: conda config --remove channels defaults

- name: Install anaconda-client
run: mamba install anaconda-client

Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/generate_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,12 @@ jobs:
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
miniforge-version: latest
use-mamba: true
use-mamba: 'true'
channels: conda-forge
conda-remove-defaults: 'true'
python-version: ${{ env.python-ver }}
activate-environment: 'coverage'

# Here is an issue in conda gh-12356 causing adding defaults to the list of channels
# upon running `conda config --append channels conda-forge`, while mamba requires to have only conda-forge channel
- name: Remove defaults channel
run: |
conda config --remove channels defaults
conda config --show
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
- name: Disable speed limit check in mamba
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
Expand Down

0 comments on commit 81047fa

Please sign in to comment.