Migrate to uv #612
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: Python package | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.8", "3.9", "3.10"] | |
| pytorch-version: ["1.4.0", "1.5.1", "1.6.0", "1.7.1", "1.8", "1.9", "1.10", "1.11", "1.12", "1.13", "2.0", "2.1", "2.2"] | |
| include: | |
| - python-version: 3.11 | |
| pytorch-version: 2.0 | |
| - python-version: 3.11 | |
| pytorch-version: 2.1 | |
| - python-version: 3.11 | |
| pytorch-version: 2.2 | |
| exclude: | |
| - python-version: 3.8 | |
| pytorch-version: 1.7.1 | |
| - python-version: 3.9 | |
| pytorch-version: 1.4.0 | |
| - python-version: 3.9 | |
| pytorch-version: 1.5.1 | |
| - python-version: 3.9 | |
| pytorch-version: 1.6.0 | |
| - python-version: 3.9 | |
| pytorch-version: 1.7.1 | |
| - python-version: 3.9 | |
| pytorch-version: 1.8 | |
| - python-version: 3.10 | |
| pytorch-version: 1.4.0 | |
| - python-version: 3.10 | |
| pytorch-version: 1.5.1 | |
| - python-version: 3.10 | |
| pytorch-version: 1.6.0 | |
| - python-version: 3.10 | |
| pytorch-version: 1.7.1 | |
| - python-version: 3.10 | |
| pytorch-version: 1.8 | |
| - python-version: 3.10 | |
| pytorch-version: 1.6.0 | |
| - python-version: 3.10 | |
| pytorch-version: 1.9 | |
| - python-version: 3.10 | |
| pytorch-version: 1.10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| uv add torch==${{ matrix.pytorch-version }} | |
| uv sync | |
| - name: mypy | |
| if: ${{ matrix.python-version == '3.11' && matrix.pytorch-version == '2.2' }} | |
| run: | | |
| uv run mypy --install-types --non-interactive . | |
| - name: pytest | |
| if: ${{ matrix.pytorch-version == '2.2' }} | |
| run: | | |
| uv run pytest --cov=torchinfo --cov-report= --durations=0 | |
| - name: pytest | |
| if: ${{ matrix.pytorch-version != '2.2' }} | |
| run: | | |
| uv run pytest --no-output -k "not test_eval_order_doesnt_matter and not test_google and not test_uninitialized_tensor and not test_input_size_half_precision and not test_recursive_with_missing_layers and not test_flan_t5_small" | |
| - name: codecov | |
| uses: codecov/codecov-action@v5 |