Skip to content

Commit 8409764

Browse files
weiji14seisman
andauthored
Use mamba to install Continuous Integration dependencies (#841)
Specifically using `mambaforge` which is a `miniconda` replacement that defaults to using the `conda-forge` channel and `mamba` instead of `conda` by default. * Set strict channel priority to conda-forge only with no defaults to see if it speeds up resolver. See also https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html#strict-channel-priority * Use mamba on GMT Dev Tests CI build * Use mamba in CI docs and Cache Data workflows * Pin gmt dev version to 6.3 on Windows CI Co-authored-by: Dongdong Tian <[email protected]>
1 parent 13f69b1 commit 8409764

File tree

4 files changed

+39
-23
lines changed

4 files changed

+39
-23
lines changed

.github/workflows/cache_data.yaml

+9-5
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,21 @@ jobs:
2424
# fecth all history so that setuptools-scm works
2525
fetch-depth: 0
2626

27-
# Setup Miniconda
28-
- name: Setup Miniconda
27+
# Install Mambaforge with conda-forge dependencies
28+
- name: Setup Mambaforge
2929
uses: conda-incubator/[email protected]
3030
with:
31-
channels: conda-forge
32-
miniconda-version: "latest"
31+
channels: conda-forge,nodefaults
32+
channel-priority: strict
33+
miniforge-version: latest
34+
miniforge-variant: Mambaforge
35+
mamba-version: "*"
36+
use-mamba: true
3337

3438
# Install GMT and other required dependencies from conda-forge
3539
- name: Install dependencies
3640
run: |
37-
conda install gmt=6.2.0 \
41+
mamba install gmt=6.2.0 \
3842
numpy pandas xarray netCDF4 packaging matplotlib
3943
4044
# Install the package that we want to test

.github/workflows/ci_docs.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,29 @@ jobs:
5454
# fecth all history so that setuptools-scm works
5555
fetch-depth: 0
5656

57-
# Setup Miniconda
58-
- name: Setup Miniconda
57+
# Install Mambaforge with conda-forge dependencies
58+
- name: Setup Mambaforge
5959
uses: conda-incubator/[email protected]
6060
with:
6161
activate-environment: pygmt
6262
python-version: ${{ matrix.python-version }}
63-
channels: conda-forge
64-
miniconda-version: "latest"
63+
channels: conda-forge,nodefaults
64+
channel-priority: strict
65+
miniforge-version: latest
66+
miniforge-variant: Mambaforge
67+
mamba-version: "*"
68+
use-mamba: true
6569

6670
# Install GMT and other required dependencies from conda-forge
6771
- name: Install dependencies
6872
run: |
69-
conda install gmt=6.2.0 numpy pandas xarray netCDF4 packaging \
73+
mamba install gmt=6.2.0 numpy pandas xarray netCDF4 packaging \
7074
ipython make myst-parser geopandas \
7175
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme
7276
7377
# Show installed pkg information for postmortem diagnostic
7478
- name: List installed packages
75-
run: conda list
79+
run: mamba list
7680

7781
# Download cached remote files (artifacts) from GitHub
7882
- name: Download remote data from GitHub

.github/workflows/ci_tests.yaml

+10-6
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,23 @@ jobs:
7777
# fecth all history so that setuptools-scm works
7878
fetch-depth: 0
7979

80-
# Setup Miniconda
81-
- name: Setup Miniconda
80+
# Install Mambaforge with conda-forge dependencies
81+
- name: Setup Mambaforge
8282
uses: conda-incubator/[email protected]
8383
with:
8484
activate-environment: pygmt
8585
python-version: ${{ matrix.python-version }}
86-
channels: conda-forge
87-
miniconda-version: "latest"
86+
channels: conda-forge,nodefaults
87+
channel-priority: strict
88+
miniforge-version: latest
89+
miniforge-variant: Mambaforge
90+
mamba-version: "*"
91+
use-mamba: true
8892

8993
# Install GMT and other required dependencies from conda-forge
9094
- name: Install dependencies
9195
run: |
92-
conda install gmt=6.2.0 numpy=${{ matrix.numpy-version }} \
96+
mamba install gmt=6.2.0 numpy=${{ matrix.numpy-version }} \
9397
pandas xarray netCDF4 packaging \
9498
${{ matrix.optional-packages }} \
9599
coverage[toml] dvc ipython make \
@@ -98,7 +102,7 @@ jobs:
98102
99103
# Show installed pkg information for postmortem diagnostic
100104
- name: List installed packages
101-
run: conda list
105+
run: mamba list
102106

103107
# Download cached remote files (artifacts) from GitHub
104108
- name: Download remote data from GitHub

.github/workflows/ci_tests_dev.yaml

+10-6
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,23 @@ jobs:
7171
# fecth all history so that setuptools-scm works
7272
fetch-depth: 0
7373

74-
# Setup Miniconda
75-
- name: Setup Miniconda
74+
# Install Mambaforge with conda-forge dependencies
75+
- name: Setup Mambaforge
7676
uses: conda-incubator/[email protected]
7777
with:
7878
activate-environment: pygmt
7979
python-version: ${{ matrix.python-version }}
80-
channels: conda-forge
81-
miniconda-version: "latest"
80+
channels: conda-forge,nodefaults
81+
channel-priority: strict
82+
miniforge-version: latest
83+
miniforge-variant: Mambaforge
84+
mamba-version: "*"
85+
use-mamba: true
8286

8387
# Install dependencies from conda-forge
8488
- name: Install dependencies
8589
run: |
86-
conda install ninja cmake libblas libcblas liblapack fftw gdal geopandas \
90+
mamba install ninja cmake libblas libcblas liblapack fftw gdal geopandas \
8791
ghostscript libnetcdf hdf5 zlib curl pcre make dvc
8892
pip install --pre numpy pandas xarray netCDF4 packaging \
8993
ipython pytest-cov pytest-mpl pytest>=6.0 sphinx-gallery \
@@ -98,7 +102,7 @@ jobs:
98102
if: runner.os != 'Windows'
99103

100104
- name: Install GMT dev version from conda-forge (Windows)
101-
run: conda install -c conda-forge/label/dev gmt
105+
run: mamba install -c conda-forge/label/dev gmt=6.3
102106
if: runner.os == 'Windows'
103107

104108
# Download cached remote files (artifacts) from GitHub

0 commit comments

Comments
 (0)