Skip to content
Closed
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
11 changes: 0 additions & 11 deletions .flake8

This file was deleted.

49 changes: 38 additions & 11 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,50 @@
# This workflow will run a test suite.
# This workflow will run linting and tests.

name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
call-linting:
uses: voightp/github-actions/.github/workflows/run-linting.yml@master
with:
os: ubuntu-latest
python-version: 3.9
call-tests:
needs: call-linting
uses: voightp/github-actions/.github/workflows/run-tests.yml@master
with:
pytest-args: "tests -v"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --group dev
- name: Run ruff check
run: uv run ruff check .
- name: Run ruff format check
run: uv run ruff format --check .
- name: Run pylint
run: uv run pylint src

test:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --group dev
- name: Run tests
run: uv run pytest tests -v
45 changes: 35 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
repos:
- repo: https://github.com/psf/black
rev: 21.8b0
# Ruff for linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.11
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
# Import sorting (isort functionality)
- id: ruff
args: [--fix, --select, I]
name: ruff-imports
# Linter
- id: ruff-check
name: ruff-check
# Formatter
- id: ruff-format
name: ruff-format

# Pylint for additional static analysis
- repo: local
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
- id: pylint
name: pylint
entry: uv run pylint
language: system
types: [python]
pass_filenames: false
args:
[
src
]

# Tests
- repo: local
hooks:
- id: isort
name: isort (python)
- id: pytest
name: pytest
entry: uv run pytest tests -q
language: system
types: [python]
pass_filenames: false
Loading
Loading