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
79 changes: 34 additions & 45 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,55 +20,43 @@ jobs:
build:
name: Build (${{ matrix.python-version }}, ${{ matrix.os }}), ${{ matrix.env }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11", "3.13"]
env: [""]
env: ["test"]
include:
- env: "all-min-deps"
- env: "test-min-deps"
python-version: "3.11"
os: ubuntu-latest
- env: "no-optional-deps"
- env: "test-no-optional"
python-version: "3.13"
os: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
if [[ "${{ matrix.env }}" == "" ]] ;
then
echo "CONDA_ENV_FILE=ci/environment.yml" >> $GITHUB_ENV
fi
if [[ "${{ matrix.env }}" == "no-optional-deps" ]] ;
then
echo "CONDA_ENV_FILE=ci/environment-no-optional-deps.yml" >> $GITHUB_ENV
fi
if [[ "${{ matrix.env }}" == "all-min-deps" ]] ;
then
echo "CONDA_ENV_FILE=ci/environment-all-min-deps.yml" >> $GITHUB_ENV
fi
- name: Set up conda environment
uses: mamba-org/setup-micromamba@v2

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
environment-file: ${{ env.CONDA_ENV_FILE }}
environment-name: cf_xarray_test
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
- name: Install cf_xarray
enable-cache: true

- name: Install dependencies
run: |
python -m pip install --no-deps -e .
uv pip install --system -e .
uv pip install --system --group ${{ matrix.env }}

- name: Run Tests
run: |
pytest -n auto --cov=./ --cov-report=xml

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v5.5.0
with:
Expand All @@ -81,33 +69,34 @@ jobs:
mypy:
name: mypy
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: ["3.11", "3.13"]
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set up conda environment
uses: mamba-org/setup-micromamba@v2

- name: Set up Python
uses: actions/setup-python@v5
with:
environment-file: ci/environment.yml
environment-name: cf_xarray_test
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
- name: Install cf_xarray
run: |
python -m pip install --no-deps -e .
- name: Install mypy
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Install dependencies
run: |
python -m pip install 'mypy'
uv pip install --system -e .
uv pip install --system --group test
uv pip install --system --group typing

- name: Run mypy
run: |
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report cf_xarray/

- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@v5.5.0
with:
Expand Down
29 changes: 13 additions & 16 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- main
schedule:
- cron: "0 0 * * *" # Daily At 00:00 UTC
- cron: "0 0 * * *" # Daily "At 00:00" UTC
workflow_dispatch: # allows you to trigger the workflow run manually

concurrency:
Expand All @@ -23,9 +23,6 @@ jobs:
name: upstream-dev
runs-on: ubuntu-latest
if: ${{ (contains( github.event.pull_request.labels.*.name, 'test-upstream') && github.event_name == 'pull_request') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
Expand All @@ -34,20 +31,20 @@ jobs:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Set up conda environment
uses: mamba-org/setup-micromamba@v2

- name: Set up Python
uses: actions/setup-python@v5
with:
environment-file: ci/upstream-dev-env.yml
environment-name: cf_xarray_test
cache-env: False
create-args: >-
python=${{ matrix.python-version }}
- name: Install cf_xarray
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
python -m pip install --no-deps -e .
uv pip install --system -e .
uv pip install --system --group test-upstream

- name: Run Tests
if: success()
id: status
Expand Down
17 changes: 9 additions & 8 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ sphinx:
build:
os: ubuntu-lts-latest
tools:
python: mambaforge-latest
python: "3.11"
jobs:
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
post_checkout:
- (git --no-pager log --pretty="tformat:%s" -1 | grep -vqF "[skip-rtd]") || exit 183
pre_install:
- conda list sphinx
- conda list cf_xarray
- conda list

conda:
environment: ci/doc.yml

formats: []
28 changes: 0 additions & 28 deletions ci/doc.yml

This file was deleted.

25 changes: 0 additions & 25 deletions ci/environment-all-min-deps.yml

This file was deleted.

13 changes: 0 additions & 13 deletions ci/environment-no-optional-deps.yml

This file was deleted.

25 changes: 0 additions & 25 deletions ci/environment.yml

This file was deleted.

22 changes: 0 additions & 22 deletions ci/upstream-dev-env.yml

This file was deleted.

Loading
Loading