test: make pre-release tests work #2091
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 | |
| uv sync --group=test # --prerelease=${PRERELEASE} | |
| uv pip install git+https://github.com/scverse/anndata.git pandas>=3.dev0 | |
| else | |
| uv sync --group=test | |
| fi | |
| if [[ -n "${DASK_VERSION}" ]]; then | |
| if [[ "${DASK_VERSION}" == "latest" ]]; then | |
| uv pip install --upgrade dask | |
| else | |
| uv pip install dask==${DASK_VERSION} | |
| fi | |
| fi | |
| - 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 }} |