Replace poetry with uv #1397
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: Python CI | |
on: | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
run-ci: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
matrix: | |
# TODO: add windows matrix | |
os: [macos-latest] | |
env: | |
REPO: ${{ github.event.pull_request.head.repo.full_name }} | |
BRANCH: ${{ github.event.pull_request.head.ref }} | |
SKIP_POETRY_SHELL: 1 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.BRANCH }} | |
repository: ${{ env.REPO }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Run tests using the shell script (macOS compatible). | |
if: matrix.os == 'macos-latest' | |
run: sh install/install_openadapt.sh | |
- name: Install uv | |
run: pip install uv | |
- name: Cache deps | |
id: cache-deps | |
uses: actions/cache@v2 | |
with: | |
path: .uv | |
key: pydeps-${{ hashFiles('**/pyproject.toml') }} | |
- name: Install dependencies | |
if: steps.cache-deps.outputs.cache-hit != 'true' | |
run: uv install | |
- name: Activate virtualenv | |
run: source .venv/bin/activate | |
if: steps.cache-deps.outputs.cache-hit == 'true' | |
- name: Check formatting with Black | |
run: uv run black --preview --check . --exclude '/(alembic|\.cache|\.uv|venv|contrib|__pycache__)/' | |
- name: Run Flake8 | |
run: uv run flake8 --exclude=alembic,.venv,venv,contrib,.cache,.git |