[libgpiod][PATCH 8/9] bindings: python: add a lint dependency group

Vincent Fazio
2026-04-01T00:18:11Z

Specify useful dependencies for linting the bindings and related code.

The group can be installed with `pip install --group lint`.

As part of this group, specify version ranges for mypy and ruff to keep
linting consistent until new minimal versions of Python are targeted or
until the new annual style introduced by ruff is chosen.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
---
bindings/python/README.md | 4 +++-
bindings/python/pyproject.toml | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/bindings/python/README.md b/bindings/python/README.md
index 89c824c..70428c0 100644
--- a/bindings/python/README.md
+++ b/bindings/python/README.md
@@ -120,10 +120,12 @@ When making changes, ensure type checks and linting still pass:
```
python3 -m venv venv
. venv/bin/activate
-pip install mypy ruff
+pip install --group lint
mypy; ruff format; ruff check
```

+Note that pip >=25.1 is necessary for `--group` support.
+
Ideally the gpiod library will continue to pass strict checks:

```
diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml
index 9961f3c..3255e89 100644
--- a/bindings/python/pyproject.toml
+++ b/bindings/python/pyproject.toml
@@ -33,6 +33,9 @@ classifiers = [
Homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git"
Issues = "https://github.com/brgl/libgpiod/issues/"

+[dependency-groups]
+lint = ["mypy>=1.18.1", "ruff~=0.15.0", "types-setuptools", "packaging"]
+
[tool.setuptools]
platforms = ["linux"]
include-package-data = false
--
2.43.0