Skip to content

Commit

Permalink
Switch to uv from poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
geigerzaehler committed Sep 11, 2024
1 parent d4ff455 commit f235ae6
Show file tree
Hide file tree
Showing 4 changed files with 389 additions and 446 deletions.
50 changes: 36 additions & 14 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Check and test

on: [push, pull_request]

env:
UV_CACHE_DIR: /tmp/.uv-cache
UV_SYSTEM_PYTHON: true
FORCE_COLOR: "1"

jobs:
build:
strategy:
Expand All @@ -17,33 +22,50 @@ jobs:
steps:
- run: sudo apt-get install flac mp3val oggz-tools
- uses: actions/checkout@v4
- run: pip install poetry
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR}}
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- run: poetry env use $(which python)
- run: poetry install
- run: poetry run ruff check .
- run: poetry run pytest
- run: uv lock --locked
- run: uv sync --all-extras --dev
- run: uv run ruff check .
- run: uv run pytest
- run: uv cache prune --ci

build-beets-versions:
runs-on: ubuntu-latest
strategy:
matrix:
beets:
- "git+https://github.com/beetbox/beets#master"
- "beets@git+https://github.com/beetbox/beets#master"
- "beets==1.6.1"

steps:
- run: sudo apt-get install flac mp3val oggz-tools
- uses: actions/checkout@v4
- run: pip install poetry
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR}}
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- uses: actions/setup-python@v5
with:
python-version: 3.9
cache: poetry
- run: poetry env use $(which python)
- run: poetry install
- run: poetry add ${{ matrix.beets }}
- run: poetry run pytest
python-version: "3.9"
- run: uv lock -P ${{ matrix.beets }}
- run: uv sync --all-extras --dev
- run: uv run pytest
- run: uv cache prune --ci
Loading

0 comments on commit f235ae6

Please sign in to comment.