Skip to content

Commit

Permalink
update github action for uv+ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
ceesem committed Nov 21, 2024
1 parent 4d38a3f commit 2b00c29
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
41 changes: 14 additions & 27 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,23 @@ on:

jobs:
build:

name: python
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
run: |
python -m pip install --upgrade pip
pip install pipx flake8
pipx install hatch
- name: Set up pip cache
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}-py#{{ matrix.python-version }}
restore-keys: ${{ runner.os }}-pip-
- 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: Run tests
run: hatch test -i python=${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: "0.5.2"
- name: Set up Python ${{ matrix.python-version }}
run : uv python install ${{ matrix.python-version }}
- name: Install project and dependencies
run: uv sync
- name: Run tests
run: uv run pytest tests
- name: Lint with ruff
run: uv run ruff check src/*
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,6 @@ commit_args = ""

[[tool.bumpversion.files]]
filename = "src/nglui/__init__.py"

[tool.ruff.lint]
select=["E9","F63","F7","F82"]

0 comments on commit 2b00c29

Please sign in to comment.