bindings: python: tests: provide and use system.check_kernel_version() master bb/master origin/HEAD origin/master
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 20 Nov 2024 13:18:20 +0000 (14:18 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 25 Nov 2024 09:03:54 +0000 (10:03 +0100)
commitdb19ece3c5d5cf5f4f9af6473285de84a6a7e388
treed4069a4a5c810f3aff6424695ff6fa2f2d47f3e6
parentaa5a1e92b1487f8ebaa71e78537226a36dd70632
bindings: python: tests: provide and use system.check_kernel_version()

We claim that libgpiod python bindings have no dependencies other than
the python standard library but this is not true - the tests do depend
on deprecated distutils for kernel version parsing.

As distutils is deprecated, the recommended improvement is to use the
Version class from packaging.version but this would too entail pulling
in an external module.

Let's instead implement the kernel version check in C using uname() and
put it into the tests.system extension. This allows us to entirely drop
the distutils import.

Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20241120-drop-distutils-v1-3-7498e8b3babe@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
bindings/python/tests/__init__.py
bindings/python/tests/system/__init__.py
bindings/python/tests/system/_ext.pyi
bindings/python/tests/system/ext.c