Skip to content

chore: switch from pip to uv #1123

chore: switch from pip to uv

chore: switch from pip to uv #1123

Workflow file for this run

name: check
on:
pull_request:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
with:
enable-cache: true
cache-dependency-glob: |
.github/requirements.txt
requirements/dev-requirements.txt
requirements/test-requirements.txt
pyproject.toml
- name: Install dependencies
run: |
set -euxo pipefail
uv venv
uv pip install --upgrade --requirements .github/requirements.txt
- run: uv run gitlint --commits "origin/$GITHUB_BASE_REF..HEAD"
if: github.event_name == 'pull_request'
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14.0-alpha - 3.14"
- "pypy-3.10"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
requirements/test-requirements.txt
- uses: wntrblm/nox@1199ab3892b1a941f80ff052083d0a571abed79d # 2024.10.09
with:
python-versions: ${{ matrix.python-version }}
- name: Run tests
run: |
v="${{ matrix.python-version }}"
v=${v##* } # "3.12.0-alpha - 3.12" -> "3.12"
v=${v//-} # "pypy-3.9" -> "pypy3.9"
nox --force-color --python "$v"
env:
NOX_DEFAULT_VENV_BACKEND: uv
PYTEST_ADDOPTS: --vcr-record=none --color=yes