Lazy load torch (#1027) #1976
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 -e {0} | |
| 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.11", dask-version: "latest", name: "Dask latest"} | |
| - {os: ubuntu-latest, python: "3.11", dask-version: "2025.2.0", name: "Dask 2025.2.0"} | |
| - {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: "2025.2.0", name: "Dask 2025.2.0"} | |
| - {os: macos-latest, python: "3.11", dask-version: "latest", name: "Dask latest"} | |
| - {os: macos-latest, python: "3.12", pip-flags: "--pre", name: "Python 3.12 (pre-release)"} | |
| env: | |
| OS: ${{ matrix.os }} | |
| PYTHON: ${{ matrix.python }} | |
| DASK_VERSION: ${{ matrix.dask-version }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: astral-sh/setup-uv@v5 | |
| id: setup-uv | |
| with: | |
| version: "latest" | |
| python-version: ${{ matrix.python }} | |
| - name: Install dependencies | |
| run: | | |
| uv sync --extra test | |
| 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@v4 | |
| with: | |
| name: coverage | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |