Skip to content

build: make zarr dependency optional #231

build: make zarr dependency optional

build: make zarr dependency optional #231

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: os=${{ matrix.os }}, py=${{ matrix.python-version }}, zarr-python=${{ matrix.zarr-version }}
strategy:
matrix:
python-version: ['3.11', '3.12', '3.13']
zarr-version: ['3.0.10', '3.1.0', 'none']
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Run Tests (with zarr)
if: matrix.zarr-version != 'none'
run: |
hatch run test.py${{ matrix.python-version }}-${{ matrix.zarr-version }}:list-env
hatch run test.py${{ matrix.python-version }}-${{ matrix.zarr-version }}:test-cov
- name: Run Tests (without zarr)
if: matrix.zarr-version == 'none'
run: |
hatch run test-base.py${{ matrix.python-version }}:list-env
hatch run test-base.py${{ matrix.python-version }}:test-cov
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true # optional (default = false)
doctests:
name: doctests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # required for hatch version discovery, which is needed for numcodecs.zarr3
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Run Tests
run: |
hatch run docs:test