test: make pre-release tests work #2096
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: "*" | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash # bash also on windows | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - {os: windows-latest, python: "3.11", dask-version: "2025.2.0", name: "Dask 2025.2.0"} | |
| - {os: windows-latest, python: "3.13", dask-version: "latest", name: "Dask latest"} | |
| - {os: ubuntu-latest, python: "3.11", dask-version: "latest", name: "Dask latest"} | |
| - {os: ubuntu-latest, python: "3.13", dask-version: "latest", name: "Dask latest"} | |
| - {os: macos-latest, python: "3.11", dask-version: "latest", name: "Dask latest"} | |
| - {os: macos-latest, python: "3.13", prerelease: "allow", name: "Python 3.13 (pre-release)"} | |
| env: | |
| OS: ${{ matrix.os }} | |
| PYTHON: ${{ matrix.python }} | |
| DASK_VERSION: ${{ matrix.dask-version }} | |
| PRERELEASE: ${{ matrix.prerelease }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| id: setup-uv | |
| with: | |
| version: "latest" | |
| python-version: ${{ matrix.python }} | |
| - name: Install dependencies | |
| run: | | |
| if [[ "${PRERELEASE}" == "allow" ]]; then | |
| sed -i 's/requires-python.*//' pyproject.toml # otherwise uv complains that anndata requires python>=3.12 and we only do >=3.11 😱 | |
| uv add git+https://github.com/scverse/anndata.git | |
| uv add pandas>=3.dev0 | |
| fi | |
| if [[ -n "${DASK_VERSION}" ]]; then | |
| if [[ "${DASK_VERSION}" == "latest" ]]; then | |
| uv add dask | |
| else | |
| uv add dask==${DASK_VERSION} | |
| fi | |
| fi | |
| uv sync --group=test | |
| - name: Test | |
| env: | |
| MPLBACKEND: agg | |
| PLATFORM: ${{ matrix.os }} | |
| DISPLAY: :42 | |
| run: | | |
| uv run pytest --cov --color=yes --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| name: coverage | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |