Skip to content
Open
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
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[Makefile]
indent_style = tab

[*.{py,cfg,ini,toml,yaml,yml,md,sh}]
indent_style = space
indent_size = 4
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "pre-commit"
directory: "/"
schedule:
interval: "weekly"
21 changes: 12 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,36 @@ on:
branches:
- main

permissions:
contents: read

jobs:
test:
name: Python ${{ matrix.python }}
name: Build (Python ${{ matrix.python }})
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']

env:
TERM: xterm-256color
RELEASE_FILE: ${{ github.event.repository.name }}-${{ github.event.release.tag_name || github.sha }}-py${{ matrix.python }}

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python }}

- name: Install Dependencies
run: |
make dev-deps

- name: Build Packages
run: |
make build
uv run make build

- name: Upload Packages
uses: actions/upload-artifact@v4
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Install Test

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
test:
name: Install (Python ${{ matrix.python }})
runs-on: ubuntu-latest
env:
TERM: xterm-256color
strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Stub files & Patch install.sh
run: |
mkdir -p boot/firmware
touch boot/firmware/config.txt
sed -i "s|/boot/firmware|`pwd`/boot/firmware|g" install.sh
sed -i "s|sudo raspi-config|raspi-config|g" pyproject.toml
touch raspi-config
chmod +x raspi-config
echo `pwd` >> $GITHUB_PATH

- name: Run install.sh
run: |
./install.sh --unstable --force
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up uv
uses: astral-sh/setup-uv@v6

- name: Build Packages
run: uv build

- name: Check version matches tag
run: |
TAG="${GITHUB_REF_NAME#v}"
BUILT="$(ls dist/*.whl | head -1 | cut -d- -f2)"
echo "tag=$TAG built=$BUILT"
if [ "$GITHUB_REF_NAME" != "$TAG" ] && [ "$TAG" != "$BUILT" ]; then
echo "::error::built $BUILT from tag $TAG"
exit 1
fi

- name: Publish
run: uv publish --trusted-publishing always
24 changes: 13 additions & 11 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,36 @@ on:
branches:
- main

permissions:
contents: read

jobs:
test:
name: linting & spelling
name: Linting & Spelling
runs-on: ubuntu-latest
env:
TERM: xterm-256color

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python '3,11'
uses: actions/setup-python@v5
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: '3.11'

- name: Install Dependencies
run: |
make dev-deps

- name: Run Quality Assurance
run: |
make qa
uv run make qa

- name: Run Code Checks
run: |
make check
uv run make check

- name: Run Bash Code Checks
- name: Run Pre-Commit
run: |
make shellcheck
uv run pre-commit run --all-files
26 changes: 13 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,36 @@ on:
branches:
- main

permissions:
contents: read

jobs:
test:
name: Python ${{ matrix.python }}
name: Test (Python ${{ matrix.python }})
runs-on: ubuntu-latest
env:
TERM: xterm-256color
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python }}

- name: Install Dependencies
run: |
make dev-deps

- name: Run Tests
run: |
make pytest
uv run make pytest

- name: Coverage
if: ${{ matrix.python == '3.9' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python -m pip install coveralls
coveralls --service=github

uvx coveralls --service=github
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ library/debian/
.coverage
.pytest_cache
.tox
.venv
uv.lock
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args: ['--fix=lf']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.20
hooks:
- id: ruff-check
args: ['--fix']
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: ['tomli']
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
5 changes: 0 additions & 5 deletions .stickler.yml

This file was deleted.

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Changelog

1.0.1
-----

* Use gpiodevice.watch_pin for the IO Expander interrupt
* Examples: use gpiodevice.Watch for the buttons
* Add a gpiodevice dependency
* Remove the unmaintained testing/ display simulator

1.0.0
-----

Expand Down
Loading
Loading