Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,17 @@ jobs:

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Set up Conda Environment
uses: conda-incubator/setup-miniconda@v3
uses: mamba-org/setup-micromamba@v2
with:
activate-environment: "compass_ci"
miniforge-version: latest
channels: conda-forge,e3sm/label/compass
channel-priority: strict
use-mamba: false
auto-update-conda: true
python-version: ${{ matrix.python-version }}
environment-name: compass_test
init-shell: bash
condarc: |
channel_priority: strict
channels:
- conda-forge
- e3sm/label/compass
create-args: >-
python=${{ matrix.python-version }}

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Install compass
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/docs_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ jobs:

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Set up Conda Environment
uses: conda-incubator/setup-miniconda@v3
uses: mamba-org/setup-micromamba@v2
with:
activate-environment: "compass_ci"
miniforge-version: latest
channels: conda-forge,e3sm/label/compass
channel-priority: strict
use-mamba: false
auto-update-conda: true
python-version: ${{ env.PYTHON_VERSION }}
environment-name: compass_test
init-shell: bash
condarc: |
channel_priority: strict
channels:
- conda-forge
- e3sm/label/compass
create-args: >-
python=${{ env.PYTHON_VERSION }}

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Install compass
Expand Down
18 changes: 9 additions & 9 deletions conda/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ def get_conda_base(conda_base, config, shared=False, warn=False):
if shared:
conda_base = config.get('paths', 'compass_envs')
elif conda_base is None:
if 'CONDA_EXE' in os.environ:
# if this is a test, assume we're the same base as the
# environment currently active
conda_exe = os.environ['CONDA_EXE']
conda_base = os.path.abspath(
os.path.join(conda_exe, '..', '..'))
try:
conda_base = subprocess.check_output(
['conda', 'info', '--base'], text=True
).strip()
if warn:
print(f'\nWarning: --conda path not supplied. Using conda '
f'installed at:\n'
f' {conda_base}\n')
else:
raise ValueError('No conda base provided with --conda and '
'none could be inferred.')
except subprocess.CalledProcessError as e:
raise ValueError(
'No conda base provided with --conda and '
'none could be inferred.'
) from e
# handle "~" in the path
conda_base = os.path.abspath(os.path.expanduser(conda_base))
return conda_base
Expand Down
Loading