Skip to content

Replace Poetry with uv and PDM #192

Replace Poetry with uv and PDM

Replace Poetry with uv and PDM #192

Workflow file for this run

name: Pre-commit
on:
push:
branches:
- main
- "releases/**"
pull_request:
branches:
- main
- "releases/**"
workflow_dispatch:
jobs:
pre-commit:
runs-on: ubuntu-latest
env:
CACHE_DIR: /opt/.cache
PRE_COMMIT_HOME: /opt/.cache/pre-commit
RUFF_CACHE_DIR: /opt/.cache/ruff
MYPY_CACHE_DIR: /opt/.cache/mypy
steps:
- uses: actions/checkout@v4
- name: Install uv
run: pipx install --pip-args="-c ${{ github.workspace }}/.github/workflows/uv-constraint.txt" uv
- uses: actions/setup-python@v5
with:
python-version-file: .python-version
cache: pip
cache-dependency-path: uv.lock
- name: Install dependencies
run: uv sync
- name: Set PY
id: set-py
run: echo "PY=$(python -VV | sha256sum | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ env.CACHE_DIR }}
key: pre-commit-${{ runner.os }}-python-${{ steps.set-py.outputs.PY }}-config-and-deps-${{ hashFiles('.pre-commit-config.yaml', 'uv.lock') }}
- name: Run pre-commit
env:
PRE_COMMIT_COLOR: always
run: uv run pre-commit run --all-files