Moving to uv + hatch #1771
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - "[0-9]+.[0-9]+.x" | |
| pull_request: | |
| env: | |
| PYTEST_ADDOPTS: "-v --color=yes -n auto" | |
| FORCE_COLOR: "1" | |
| MPLBACKEND: agg | |
| # It's impossible to ignore SyntaxWarnings for a single module, | |
| # so because leidenalg 0.10.0 has them, we pre-compile things: https://github.com/vtraag/leidenalg/issues/173 | |
| UV_COMPILE_BYTECODE: "1" | |
| defaults: | |
| run: | |
| shell: bash -e {0} # -e to fail on error | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: hatch-test.py3.11-stable | |
| os: ubuntu-latest | |
| python: "3.11" | |
| - name: hatch-test.py3.12-stable | |
| os: ubuntu-latest | |
| python: "3.12" | |
| - name: hatch-test.py3.13-stable | |
| os: ubuntu-latest | |
| python: "3.13" | |
| - name: hatch-test.py3.13-stable | |
| os: macos-latest | |
| python: "3.13" | |
| prerelease: "allow" | |
| env: # environment variable for use in codecov's env_vars tagging | |
| ENV_NAME: ${{ matrix.name }} | |
| UV_PRERELEASE: ${{ matrix.prerelease || 'disallow' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| filter: blob:none | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python }} | |
| cache-dependency-glob: pyproject.toml | |
| - name: Ensure figure directory exists | |
| run: mkdir -p "$GITHUB_WORKSPACE/tests/figures" | |
| - name: Cache downloaded data | |
| uses: actions/cache@v4 | |
| with: | |
| path: .pytest_cache/d/squidpy-data | |
| key: pytest | |
| - name: Install dependencies | |
| run: uvx hatch -v env create ${{ matrix.name }} | |
| - name: Run tests (coverage) | |
| if: matrix.test-type == 'coverage' | |
| run: uvx hatch run ${{ matrix.name }}:run-cov --cov --cov-report=xml | |
| - name: Archive figures generated during testing | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: visual_test_results_${{ runner.os }}_py${{ matrix.name }} | |
| path: ${{ github.workspace }}/tests/figures/* | |
| - name: Upload coverage data | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| env_vars: ENV_NAME | |
| fail_ci_if_error: true | |
| files: test-data/coverage.xml | |
| check: | |
| if: always() | |
| needs: | |
| - test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |