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
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
versioning-strategy: increase-if-necessary

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
288 changes: 0 additions & 288 deletions .github/workflows/lint_pr.yml

This file was deleted.

82 changes: 54 additions & 28 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,62 @@
name: lint_python
on: [pull_request, push]
name: Python CI

on:
push:
pull_request:

permissions:
contents: read

concurrency:
group: python-ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint_python:
quality:
name: Lint, type-check, and test
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v6

- uses: actions/setup-python@v6
with:
python-version: 3.12
- name: Install dependencies
python-version: "3.12"
cache: pip
cache-dependency-path: Pipfile.lock

- name: Run quality checks
run: ./lint.sh

tests:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- uses: actions/checkout@v6

- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: Pipfile.lock

- name: Install locked dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Lint with flake8
run: flake8 ./patterns --count --show-source --statistics
continue-on-error: true
- name: Format check with isort and black
run: |
isort --profile black --check ./patterns
black --check ./patterns
continue-on-error: true
- name: Type check with mypy
run: mypy --ignore-missing-imports ./patterns || true
continue-on-error: true
- name: Run tests with pytest
run: |
pytest ./patterns
pytest --doctest-modules ./patterns || true
continue-on-error: true
- name: Check Python version compatibility
run: shopt -s globstar && pyupgrade --py312-plus ./patterns/**/*.py
continue-on-error: true
- name: Run tox
run: tox
continue-on-error: true
python -m pip install pipenv
pipenv requirements --dev > "${RUNNER_TEMP}/requirements-dev.txt"
python -m pip install -r "${RUNNER_TEMP}/requirements-dev.txt"
python -m pip install --no-build-isolation --no-deps -e .

- name: Run tests
run: python -m pytest tests patterns
Loading