Moving to uv + hatch #1739
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: Test | |
| on: | |
| schedule: | |
| - cron: 00 00 * * 1 # every Monday at 00:00 | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| reason: | |
| description: Reason for the workflow dispatch. Only "release" is valid. | |
| required: true | |
| default: release | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: ["3.10", "3.11", "3.12"] | |
| os: [ubuntu-latest] | |
| include: | |
| - python: "3.12" | |
| os: macos-latest | |
| env: | |
| OS: ${{ matrix.os }} | |
| PYTHON: ${{ matrix.python }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: | | |
| ./.scripts/ci/install_dependencies.sh | |
| - name: Restore data cache | |
| id: data-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/squidpy/*.h5ad | |
| key: data-${{ hashFiles('**/download_data.py') }} | |
| - name: Download datasets | |
| if: steps.data-cache.outputs.cache-hit != 'true' | |
| run: | | |
| uvx hatch run data:download | |
| - name: Test | |
| timeout-minutes: 60 | |
| env: | |
| MPLBACKEND: agg | |
| PLATFORM: ${{ matrix.os }} | |
| DISPLAY: :42 | |
| PYTEST_ADDOPTS: "-n auto" | |
| run: | | |
| uvx hatch test --python ${{ matrix.python }} --randomize --parallel --cover --all | |
| - name: Archive figures generated during testing | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: visual_test_results_${{ matrix.os }}-python${{ matrix.python }} | |
| path: tests/figures/* | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| name: coverage | |
| verbose: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| check: | |
| if: always() | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |