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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

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

- name: Set up uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python }}
Expand All @@ -38,7 +38,7 @@ jobs:
uv run make build

- name: Upload Packages
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ env.RELEASE_FILE }}
path: dist/
4 changes: 2 additions & 2 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:

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

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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:

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

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

- name: Build Packages
run: uv build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:

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

- name: Set up uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: '3.11'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:

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

- name: Set up uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python }}
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.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
rev: v0.16.4
hooks:
- id: ruff-check
args: ['--fix']
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.3
hooks:
- id: codespell
additional_dependencies: ['tomli']
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
rev: v0.11.0.1
hooks:
- id: shellcheck
9 changes: 5 additions & 4 deletions gpiodevice/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import glob
import re
import sys
from importlib.metadata import PackageNotFoundError, version
from pathlib import Path
from typing import Optional, Union

import gpiod

Expand Down Expand Up @@ -55,7 +56,7 @@ def check_pins_available(chip: gpiod.Chip, pins, fatal: bool = True) -> bool:


@errors.collect
def find_chip_by_label(labels: Union[list[str], tuple[str, ...], str], pins: Optional[dict[str, Union[int, str]]] = None, fatal: bool = True):
def find_chip_by_label(labels: list[str] | tuple[str, ...] | str, pins: dict[str, int | str] | None = None, fatal: bool = True):
"""Try to find a gpiochip device matching one of a set of labels.

Raise a RuntimeError with a friendly error digest if one is not found.
Expand Down Expand Up @@ -88,7 +89,7 @@ def find_chip_by_label(labels: Union[list[str], tuple[str, ...], str], pins: Opt


@errors.collect
def find_chip_by_pins(pins: Union[list[str], tuple[str, ...], str, int], ignore_claimed: bool = False, fatal: bool = True):
def find_chip_by_pins(pins: list[str] | tuple[str, ...] | str | int, ignore_claimed: bool = False, fatal: bool = True):
"""Try to find a gpiochip device that includes all of the named pins.

Does not care whether pins are in use or not.
Expand Down Expand Up @@ -185,4 +186,4 @@ def get_pins_for_platform(platforms):


# Edge / interrupt helpers (imported last to avoid a cycle with watch_pin's use of get_pin)
from .watch import Watch, wait_for_edge, watch_pin # noqa: E402,F401
from .watch import Watch, wait_for_edge, watch_pin # noqa: F401
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Homepage = "https://www.pimoroni.com"
[dependency-groups]
dev = [
"check-manifest",
"ruff==0.15.20",
"ruff==0.16.4",
"codespell",
"pre-commit",
"twine",
Expand Down
Loading