Skip to content

Commit

Permalink
use micromamba instead of mamba (#6674)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
keewis authored Jun 10, 2022
1 parent 27d6266 commit a7799fb
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 57 deletions.
75 changes: 47 additions & 28 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,29 @@ jobs:
run:
shell: bash -l {0}

env:
CONDA_ENV_FILE: ci/requirements/environment.yml
PYTHON_VERSION: "3.10"

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
activate-environment: xarray-tests
auto-update-conda: false
python-version: "3.9"

- name: Install conda dependencies
- name: set environment variables
run: |
mamba env update -f ci/requirements/environment.yml
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
with:
environment-file: ${{env.CONDA_ENV_FILE}}
environment-name: xarray-tests
extra-specs: |
python=${{env.PYTHON_VERSION}}
cache-env: true
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"

- name: Install xarray
run: |
python -m pip install --no-deps -e .
Expand All @@ -76,23 +83,27 @@ jobs:
defaults:
run:
shell: bash -l {0}
env:
CONDA_ENV_FILE: ci/requirements/environment.yml
PYTHON_VERSION: "3.10"

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
activate-environment: xarray-tests
auto-update-conda: false
python-version: "3.9"

- name: Install conda dependencies
- name: set environment variables
run: |
mamba env update -f ci/requirements/environment.yml
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
with:
environment-file: ${{env.CONDA_ENV_FILE}}
environment-name: xarray-tests
extra-specs: |
python=${{env.PYTHON_VERSION}}
cache-env: true
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
- name: Install xarray
run: |
python -m pip install --no-deps -e .
Expand All @@ -118,20 +129,28 @@ jobs:
run:
shell: bash -l {0}

strategy:
matrix:
environment-file: ["bare-minimum", "min-all-deps"]
fail-fast: false

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- uses: conda-incubator/setup-miniconda@v2

- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
with:
environment-name: xarray-tests
environment-file: false
extra-specs: |
python=3.10
pyyaml
conda
python-dateutil
channels: conda-forge
channel-priority: strict
mamba-version: "*"
auto-update-conda: false
python-version: "3.9"

- name: minimum versions policy
run: |
mamba install -y pyyaml conda python-dateutil
python ci/min_deps_check.py ci/requirements/bare-minimum.yml
python ci/min_deps_check.py ci/requirements/min-all-deps.yml
python ci/min_deps_check.py ci/requirements/${{ matrix.environment-file }}.yml
26 changes: 8 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ jobs:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if [[ ${{ matrix.os }} == windows* ]] ;
then
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV
Expand All @@ -83,25 +85,13 @@ jobs:
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Cache conda
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ hashFiles('ci/requirements/**.yml') }}-${{ matrix.env }}

- uses: conda-incubator/setup-miniconda@v2
- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
activate-environment: xarray-tests
auto-update-conda: false
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: true

- name: Install conda dependencies
run: |
mamba env update -f $CONDA_ENV_FILE
environment-file: ${{ env.CONDA_ENV_FILE }}
environment-name: xarray-tests
cache-env: true
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"

# We only want to install this on one run, because otherwise we'll have
# duplicate annotations.
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,15 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
activate-environment: xarray-tests
auto-update-conda: false
python-version: ${{ matrix.python-version }}
- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
with:
environment-file: ci/requirements/environment.yml
environment-name: xarray-tests
extra-specs: |
python=${{ matrix.python-version }}
- name: Install upstream versions
run: |
mamba env update -f ci/requirements/environment.yml
bash ci/install-upstream-wheels.sh
- name: Install xarray
run: |
Expand Down
4 changes: 2 additions & 2 deletions ci/requirements/bare-minimum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ dependencies:
- pytest-cov
- pytest-env
- pytest-xdist
- numpy=1.18
- numpy=1.19
- packaging=20.0
- pandas=1.1
- pandas=1.2

0 comments on commit a7799fb

Please sign in to comment.