On Thu, Nov 14, 2024 at 3:58 PM Vincent Fazio <vfazio@xxxxxxxxxxx> wrote: > > This patch series employs mypy [0] and ruff [1] to ensure the gpiod > library has correctly typed public interfaces, is performing proper type > checking internally, is consistently formatted in a standard code style > that targets Python 3.9 syntax, and passes a subset of linting checks. > > Patches 1 and 2 remove unused imports, sort and guard the remainder, and > ensure the publicly usable classes are available from the gpiod module. > > Patches 3-5 fix and add type hints to callable interfaces. > > Patches 6-14 fix type and lint errors internal to the bindings. > > Patch 15 fixes a duplicate test name identified by the linter. > > Patch 16 and 17 remove unused imports, sort the remainder, and fix lint > errors related to a shadowed export. > > Patches 18 and 19 fix and add type hints to callable interfaces within > the tests. > > Patches 20-22 fix type and lint errors internal to the tests. > > Patch 23 adds mypy and ruff configuration to pyproject.toml and adds > documentation to the readme so future patches can be evaluated against a > standard set of rules. > > There should be no functional changes that impact existing code as part > of this series. > > All unit tests continue to pass without changes and code coverage has > not changed. > > After this series is applied, the public type annotations will reflect > the argument expectations of the class methods so consumers can type > check their code against the gpiod type annotations. > Thanks for your work, this really improves the bindings. On a related note: we still have some uses of deprecated distutils in the code. Do you know how we should replace LooseVersion to not use it anymore? Bart