Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 17 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Tests

on: [push, pull_request]
on:
pull_request:
push:
branches:
- main

jobs:
ruff:
Expand All @@ -22,25 +26,15 @@ jobs:
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get full python version
id: full-python-version
run: |
echo version=$(python -c "import sys, platform; print('.'.join(str(v) for v in sys.version_info[:3]) + '_' + platform.machine())") >> $GITHUB_OUTPUT
- name: Set up cache
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install and configure Poetry
run: |
pip install poetry
poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install --all-extras
- name: Pytest
run: make test
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
version: latest
enable-cache: true
- name: Run pytest
run: uv run make test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ __pycache__
.\#*
build
dist
*.egg-info
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
all:

test:
poetry run pytest --ruff --ruff-format
uv run pytest --ruff --ruff-format

lint:
poetry run ruff check .
uv run ruff check .

reformat:
poetry run ruff check --select I --fix .
poetry run ruff format .
uv run ruff check --select I --fix .
uv run ruff format .

clean:

realclean: clean
poetry env remove --all
rm -fr .venv
Loading