Skip to content

Commit a7799fb

Browse files
authored
use micromamba instead of mamba (#6674)
* use micromamba instead of mamba * specify the version of the micromamba GA * use a commit hash instead, cache-env has never been released yet * properly access the environment variable * use micromamba in the additional CI * uses micromamba in the upstream-dev CI [test-upstream] * synchronise the minimum tested pandas version with setup.cfg * fix the workflow * try if removing the environment cache works [skip-ci] * synchronise the minimum numpy version * don't cache the upstream-dev environment [test-upstream] * specify the environment name and don't use a file [skip-ci] * trigger ci * use conda-forge * set manual cache keys * fix the mypy job's caching * fix the date call * assign a name to the extra step to get the date * rerun all CI [test-upstream] * include the python version in the cache key * rerun CI
1 parent 27d6266 commit a7799fb

File tree

4 files changed

+64
-57
lines changed

4 files changed

+64
-57
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,29 @@ jobs:
3939
run:
4040
shell: bash -l {0}
4141

42+
env:
43+
CONDA_ENV_FILE: ci/requirements/environment.yml
44+
PYTHON_VERSION: "3.10"
45+
4246
steps:
4347
- uses: actions/checkout@v3
4448
with:
4549
fetch-depth: 0 # Fetch all history for all branches and tags.
46-
- uses: conda-incubator/setup-miniconda@v2
47-
with:
48-
channels: conda-forge
49-
channel-priority: strict
50-
mamba-version: "*"
51-
activate-environment: xarray-tests
52-
auto-update-conda: false
53-
python-version: "3.9"
5450

55-
- name: Install conda dependencies
51+
- name: set environment variables
5652
run: |
57-
mamba env update -f ci/requirements/environment.yml
53+
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
54+
55+
- name: Setup micromamba
56+
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
57+
with:
58+
environment-file: ${{env.CONDA_ENV_FILE}}
59+
environment-name: xarray-tests
60+
extra-specs: |
61+
python=${{env.PYTHON_VERSION}}
62+
cache-env: true
63+
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
64+
5865
- name: Install xarray
5966
run: |
6067
python -m pip install --no-deps -e .
@@ -76,23 +83,27 @@ jobs:
7683
defaults:
7784
run:
7885
shell: bash -l {0}
86+
env:
87+
CONDA_ENV_FILE: ci/requirements/environment.yml
88+
PYTHON_VERSION: "3.10"
7989

8090
steps:
8191
- uses: actions/checkout@v3
8292
with:
8393
fetch-depth: 0 # Fetch all history for all branches and tags.
84-
- uses: conda-incubator/setup-miniconda@v2
85-
with:
86-
channels: conda-forge
87-
channel-priority: strict
88-
mamba-version: "*"
89-
activate-environment: xarray-tests
90-
auto-update-conda: false
91-
python-version: "3.9"
9294

93-
- name: Install conda dependencies
95+
- name: set environment variables
9496
run: |
95-
mamba env update -f ci/requirements/environment.yml
97+
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
98+
- name: Setup micromamba
99+
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
100+
with:
101+
environment-file: ${{env.CONDA_ENV_FILE}}
102+
environment-name: xarray-tests
103+
extra-specs: |
104+
python=${{env.PYTHON_VERSION}}
105+
cache-env: true
106+
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
96107
- name: Install xarray
97108
run: |
98109
python -m pip install --no-deps -e .
@@ -118,20 +129,28 @@ jobs:
118129
run:
119130
shell: bash -l {0}
120131

132+
strategy:
133+
matrix:
134+
environment-file: ["bare-minimum", "min-all-deps"]
135+
fail-fast: false
136+
121137
steps:
122138
- uses: actions/checkout@v3
123139
with:
124140
fetch-depth: 0 # Fetch all history for all branches and tags.
125-
- uses: conda-incubator/setup-miniconda@v2
141+
142+
- name: Setup micromamba
143+
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
126144
with:
145+
environment-name: xarray-tests
146+
environment-file: false
147+
extra-specs: |
148+
python=3.10
149+
pyyaml
150+
conda
151+
python-dateutil
127152
channels: conda-forge
128-
channel-priority: strict
129-
mamba-version: "*"
130-
auto-update-conda: false
131-
python-version: "3.9"
132153

133154
- name: minimum versions policy
134155
run: |
135-
mamba install -y pyyaml conda python-dateutil
136-
python ci/min_deps_check.py ci/requirements/bare-minimum.yml
137-
python ci/min_deps_check.py ci/requirements/min-all-deps.yml
156+
python ci/min_deps_check.py ci/requirements/${{ matrix.environment-file }}.yml

.github/workflows/ci.yaml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ jobs:
6565
fetch-depth: 0 # Fetch all history for all branches and tags.
6666
- name: Set environment variables
6767
run: |
68+
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
69+
6870
if [[ ${{ matrix.os }} == windows* ]] ;
6971
then
7072
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV
@@ -83,25 +85,13 @@ jobs:
8385
8486
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
8587
86-
- name: Cache conda
87-
uses: actions/cache@v3
88-
with:
89-
path: ~/conda_pkgs_dir
90-
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ hashFiles('ci/requirements/**.yml') }}-${{ matrix.env }}
91-
92-
- uses: conda-incubator/setup-miniconda@v2
88+
- name: Setup micromamba
89+
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
9390
with:
94-
channels: conda-forge
95-
channel-priority: strict
96-
mamba-version: "*"
97-
activate-environment: xarray-tests
98-
auto-update-conda: false
99-
python-version: ${{ matrix.python-version }}
100-
use-only-tar-bz2: true
101-
102-
- name: Install conda dependencies
103-
run: |
104-
mamba env update -f $CONDA_ENV_FILE
91+
environment-file: ${{ env.CONDA_ENV_FILE }}
92+
environment-name: xarray-tests
93+
cache-env: true
94+
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
10595

10696
# We only want to install this on one run, because otherwise we'll have
10797
# duplicate annotations.

.github/workflows/upstream-dev-ci.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,15 @@ jobs:
5555
- uses: actions/checkout@v3
5656
with:
5757
fetch-depth: 0 # Fetch all history for all branches and tags.
58-
- uses: conda-incubator/setup-miniconda@v2
59-
with:
60-
channels: conda-forge
61-
channel-priority: strict
62-
mamba-version: "*"
63-
activate-environment: xarray-tests
64-
auto-update-conda: false
65-
python-version: ${{ matrix.python-version }}
6658
- name: Set up conda environment
59+
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
60+
with:
61+
environment-file: ci/requirements/environment.yml
62+
environment-name: xarray-tests
63+
extra-specs: |
64+
python=${{ matrix.python-version }}
65+
- name: Install upstream versions
6766
run: |
68-
mamba env update -f ci/requirements/environment.yml
6967
bash ci/install-upstream-wheels.sh
7068
- name: Install xarray
7169
run: |

ci/requirements/bare-minimum.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ dependencies:
1010
- pytest-cov
1111
- pytest-env
1212
- pytest-xdist
13-
- numpy=1.18
13+
- numpy=1.19
1414
- packaging=20.0
15-
- pandas=1.1
15+
- pandas=1.2

0 commit comments

Comments
 (0)