Replace poetry with uv #31
Workflow file for this run
This file contains 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: Linters and tests | |
on: [pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
name: Lint code | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.5.31" | |
- uses: actions/cache@v4 | |
id: cache | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-uv | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
uv pip install --system .[dev] | |
- name: Run linters | |
run: make lint | |
test: | |
runs-on: ubuntu-latest | |
name: Run tests | |
strategy: | |
matrix: | |
python-version: [ "3.9", "3.10", "3.11", "3.12" ] | |
pydantic-version: [ "pydantic-v1", "pydantic-v2" ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.5.31" | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v4 | |
id: cache | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-uv | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
uv pip install --system .[dev] | |
- name: Install Pydantic v1 | |
if: matrix.pydantic-version == 'pydantic-v1' | |
run: uv pip install --system "pydantic>=1.10.0,<2.0.0" | |
- name: Install Pydantic v2 | |
if: matrix.pydantic-version == 'pydantic-v2' | |
run: uv pip install --system --prerelease=disallow "pydantic>=2.0.0,<3.0.0" | |
- run: mkdir coverage | |
- name: Test | |
run: make test |