Skip to content

Commit

Permalink
Update CI workflow to use uv and ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
kaar committed Dec 20, 2024
1 parent 7cef8a8 commit 2055904
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
39 changes: 17 additions & 22 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,30 @@ name: Python application

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
# https://docs.astral.sh/uv/guides/integration/github/#setting-up-python
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --all-extras --dev
# https://docs.astral.sh/ruff/integrations
- name: Run Ruff
run: uv run ruff check --output-format=github .
- name: Run Format
run: uv run ruff ruff format --diff
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ li = "linear.cli:cli"
[tool.pyright]
venvPath = ".venv"

[tool.uv]
dev-dependencies = [
"ruff>=0.8.4",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

0 comments on commit 2055904

Please sign in to comment.