- Feb 11, 2025
-
-
Bartosz Golaszewski authored
Changelog: - fix tests failing after a kernel fix to gpio-sim Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Feb 05, 2025
-
-
Bartosz Golaszewski authored
Linux kernel commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an instantiated device depends on") uncovered an issue in Python bindings tests where the GPIO simulator device is not disabled before removing its configfs entries. Reorder the operations in chip_finalize() in order to disable the device first (if needed) before releasing any other resources. Link: https://lore.kernel.org/r/20250203-fix-gpiosim-in-bindings-v1-2-d2c9e0f3a29d@linaro.org Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Dec 20, 2024
-
-
Bartosz Golaszewski authored
Small bugfix release. Changelog: - remove unused import from chip.py - fix potential crash due to invalid usage of PyDict_Next() Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Dec 02, 2024
-
-
George Harker authored
PyDict_Next() does not guarantee pos is contiguous, and pypy increments it past the end of the dict size. Fix reliance on pos for constructing args for libgpiod call. Fixes: b7ba732e ("treewide: libgpiod v2 implementation") Signed-off-by:
George Harker <george@george-graphics.co.uk> Link: https://lore.kernel.org/r/20241202171302.51437-1-george@george-graphics.co.uk Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Nov 13, 2024
-
-
Bartosz Golaszewski authored
We no longer use the select module directly in chip.py so drop the unneeded import. Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Nov 12, 2024
-
-
Bartosz Golaszewski authored
Minor gpiod package release. Changelog: - fix Chip.request_lines() typing - improve the output of LineSettings.__repr__() - import gpiod attributes in external module - specify a tar extract filter for python >= 3.12 Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Vincent Fazio authored
Starting in Python 3.12, extracting files from tarballs without a filter specified generates a DeprecationWarning [0]. For Python >= 3.12, specify the `fully_trusted_filter` filter which replicates the behavior from previous versions. This filter also makes sense as we should be able to trust the tarball the maintainers generate after the hash has been verified. [0]: https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter Signed-off-by:
Vincent Fazio <vfazio@xes-inc.com> Link: https://lore.kernel.org/r/20241107205001.574426-1-vfazio@xes-inc.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Oct 14, 2024
-
-
Vincent Fazio authored
Previously, the external module relied on gpiod attributes being present within `globals()` to construct return values back to the caller. This assumption required callers of the external module to have imported the attributes to populate `globals()` for the interface to work. Having this implicit contract is opaque and prone to causing issues if imports within gpiod modules ever get reworked. Now, the external module explicitly imports attributes from gpiod in order to return values back to the caller. There should be no concern about circular imports as the external module should be completely imported by the time callers call into it. Since Py_gpiod_GetGlobalType is no longer used, it has been replaced with Py_gpiod_GetModuleAttrString which returns a new PyObject* reference for the named module and attribute that must be decremented when no longer in use. Closes: https://github.com/brgl/libgpiod/issues/101 Signed-off-by:
Vincent Fazio <vfazio@xes-inc.com> Link: https://lore.kernel.org/r/20241008175139.1198980-1-vfazio@xes-inc.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Sep 27, 2024
-
-
Bartosz Golaszewski authored
Currently, for the output of LineSettings.__repr__() to be eval()able, the user must have pulled all the relevant definitions from gpiod.line within the scope where it is used. Modify the output so that all the user needs is `import gpiod`. Reported-by:
Vincent Fazio <vfazio@gmail.com> Link: https://lore.kernel.org/r/20240920143203.6377-1-brgl@bgdev.pl Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Sep 16, 2024
-
-
Vincent Fazio authored
The output_values argument was typed as a dict of tuples, however, the code expects a dict of int|str. Fixes: 27a69b0b ("bindings: python: add the output_values argument to Chip.request_lines()") Closes: https://github.com/brgl/libgpiod/issues/96 Signed-off-by:
Vincent Fazio <vfazio@gmail.com> Link: https://lore.kernel.org/r/20240914183352.16090-1-vfazio@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Aug 01, 2024
-
-
Bartosz Golaszewski authored
Minor gpiod package release. Changelog: - fix requesting lines by name with multiple entries - fix a use-after-free bug in python bindings - fix passing the event clock property to line requests in python bindings Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Benjamin Cabé authored
Python binding was ignoring event_clock line setting. Signed-off-by:
Benjamin Cabé <kartben@gmail.com> Reviewed-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240731104658.93117-1-brgl@bgdev.pl Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Iker Pedrosa authored
`req_cfg` variable is freed and then used, which would generate an error. Avoid this problem by freeing when the variable will no longer be used. Signed-off-by:
Iker Pedrosa <ikerpedrosam@gmail.com> Reviewed-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/3d8b12dd60eec59d4184c0bcc7d575b4eccbc22c.1722250385.git.ikerpedrosam@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Chuang Zhu authored
When multiple entries are requested using line names in Chip.request_lines(), only the the last entry is added to LineRequest._name_map, causing a ValueError when trying to use functions like LineRequest.set_value() on any former entries. Move the required variables to the correct scope. Signed-off-by:
Chuang Zhu <git@chuang.cz> [Bartosz: tweak the commit message] Co-developed-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240710125719.33655-2-brgl@bgdev.pl Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Jun 18, 2024
-
-
Bartosz Golaszewski authored
Minor gpiod package release. Changelog: - add a script for generating sdist and wheels - fix make build - support casting of line.Value to bool - test fixes - fix __repr__() implementations Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Jun 14, 2024
-
-
Bartosz Golaszewski authored
Extend the "Contributing" section of the README to include mentions of shell scripts having to pass the `shellcheck` test and the entire tree having to conform to `reuse lint` requirements. Link: https://lore.kernel.org/r/20240613140117.39048-1-brgl@bgdev.pl Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Jun 12, 2024
-
-
Vincent Fazio authored
Introduce a shell script that generates an sdist tarball and PEP 600/656 conformant wheels. The wheels are generated via cibuildwheel, a tool provided by the Python Packaging Authority (PyPA) [0]. The tool leverages toolchains within containers maintained by PyPA [1] to generate wheels that are runnable on hosts that meet the platform compatibility tag [2] requirements. By default, the script creates X86_64 and AArch64 CPython 3.9-3.12 wheels for glibc and musl libc based systems. These defaults can be overridden via CIBW_* environment variables [3]. [0]: https://cibuildwheel.pypa.io/en/stable/ [1]: https://github.com/pypa/manylinux/ [2]: https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/ [3]: https://cibuildwheel.pypa.io/en/stable/options/#options-summary Signed-off-by:
Vincent Fazio <vfazio@gmail.com> Link: https://lore.kernel.org/r/20240611205041.1448276-1-vfazio@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Jun 03, 2024
-
-
Kent Gibson authored
Fix shellcheck SC2046[1], SC2068[2], SC2068[3] and SC2206[4], all of which are related to avoiding word splitting and globbing. [1] https://www.shellcheck.net/wiki/SC2046 [2] https://www.shellcheck.net/wiki/SC2068 [3] https://www.shellcheck.net/wiki/SC2086 [4] https://www.shellcheck.net/wiki/SC2206 Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240603115628.102616-9-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
Fix shellcheck SC1091 - not following. Use a directive to prevent shellcheck complaining about sourcing shunit2, which we don't care to check. [1] https://www.shellcheck.net/wiki/SC1091 Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240603115628.102616-8-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
Fix shellcheck SC2181[1] - check exit code directly. [1] https://www.shellcheck.net/wiki/SC2181 Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240603115628.102616-7-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
Fix shellcheck SC2059[1] - don't use variables in the printf format string. [1] https://www.shellcheck.net/wiki/SC2059 Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240603115628.102616-6-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
Fix shellcheck SC2162[1] - read without -r will mangle backslashes. [1] https://www.shellcheck.net/wiki/SC2162 Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240603115628.102616-5-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
Fix shellckeck SC2034[1] - foo appears unused. Prefix intentionally unused variables with "_" and remove variables not actually used. [1] https://www.shellcheck.net/wiki/SC2034 Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240603115628.102616-4-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
Fix shellcheck SC2155[1] - declare and assign separately to avoid masking return values. [1] https://www.shellcheck.net/wiki/SC2155 Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240603115628.102616-3-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
Fix shellcheck SC2145[1] - argument mixes string and array. Separate the command from the array of arguments to avoid mixing. [1] https://www.shellcheck.net/wiki/SC2145 Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240603115628.102616-2-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Khem Raj authored
Catch2 v3.x has API changes which needs to be addressed in the tests themselves, hence this changeset is to fix those. Signed-off-by:
Khem Raj <raj.khem@gmail.com> Link: https://lore.kernel.org/r/20240531184223.3949069-1-raj.khem@gmail.com [Bartosz: added a version requirement (>= 3.0) for catch2 to configure.ac] Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- May 29, 2024
-
-
Bartosz Golaszewski authored
We only use grep in one place where we don't really need it as we can use find directly. Reported-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Suggested-by:
Kent Gibson <warthog618@gmail.com> Reviewed-by:
Kent Gibson <warthog618@gmail.com> Reviewed-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240528-fix-bash-tests-v3-4-e9b5be2ba8bf@linaro.org Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Bartosz Golaszewski authored
We're already breaking the line between while and do so there's no need for the ';' character. Suggested-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
Kent Gibson <warthog618@gmail.com> Reviewed-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240528-fix-bash-tests-v3-3-e9b5be2ba8bf@linaro.org Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Bartosz Golaszewski authored
$@ does not break up quoted arguments which is what we want in all cases in the bash test-suite. Use it instead of $*. While at it: prevent globbing with double quotes but allow variable expansion. Suggested-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
Kent Gibson <warthog618@gmail.com> Reviewed-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240528-fix-bash-tests-v3-2-e9b5be2ba8bf@linaro.org Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Bartosz Golaszewski authored
Replace all spaces used for indentation with tabs. Suggested-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
Kent Gibson <warthog618@gmail.com> Reviewed-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240528-fix-bash-tests-v3-1-e9b5be2ba8bf@linaro.org Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- May 28, 2024
-
-
Kent Gibson authored
The python-tests-run target is broken as it does not correctly split lines. It also calls Python directly rather then through the $PYTHON variable. Fix the line splitting and call Python using the $PYTHON variable. Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240526113234.253859-3-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
Add a section describing how to run the test suite. Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240526113234.253859-2-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- May 23, 2024
-
-
Bartosz Golaszewski authored
Make the new test file for line definitions part of the entire test-suite for python bindings. Fixes: c8e3ae04 ("bindings: python: tests: add test for casting line.Value to bool") Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
The line.Value represents the logical line state, so intuitively you would expect it to be able to be cast to bool, with ACTIVE corresponding to True, and INACTIVE to False. Add a test that line.Value can be cast to bool. Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240522004643.96863-2-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Kent Gibson authored
Python types default to being truthy when cast to bool, so casting line.Value to bool always returns True. Add a line.Value.__bool__() operator to map the line value to bool as one would intuitively expect, so ACTIVE is True and INACTIVE is False. Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240522004643.96863-3-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
Bartosz Golaszewski authored
Current Catch2 release is v3.6. C++ tests in libgpiod still use v2.x. Catch2 v2 and v3 are not compatible and the tests must be migrated to the most recent major release. Add a task for it to TODO. Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- May 22, 2024
-
-
Bartosz Golaszewski authored
Use double '/' for escaping regex special characters for patterns in python strings to silence the following warnings: bindings/python/tests/tests_edge_event.py:211: SyntaxWarning: invalid escape sequence '\.' "<EdgeEvent type=Type\.RISING_EDGE timestamp_ns=[0-9]+ line_offset=0 global_seqno=1 line_seqno=1>", bindings/python/tests/tests_info_event.py:188: SyntaxWarning: invalid escape sequence '\.' '<InfoEvent type=Type\.LINE_REQUESTED timestamp_ns=[0-9]+ line_info=<LineInfo offset=0 name="None" used=True consumer="\?" direction=Direction\.INPUT active_low=False bias=Bias\.UNKNOWN drive=Drive\.PUSH_PULL edge_detection=Edge\.NONE event_clock=Clock\.MONOTONIC debounced=False debounce_period=0:00:00>>', Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- May 15, 2024
-
-
Kent Gibson authored
A bug was recently discovered in the kernel that can result in the edge event fifo not being correctly initialised and stack contents being returned in edge events. The trigger for the bug is requesting a line with debounce, but not edge detection, and then reconfiguring the line to enable edge detection. Add a test case that triggers the bug. This will fail on kernels that do not contain the fix for the bug. The test is located in a new test file, tests-kernel-uapi.c, intended to contain tests specifically testing some aspect of the kernel uAPI, not libgpiod itself. Signed-off-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240513160031.309139-1-warthog618@gmail.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- May 13, 2024
-
-
Bartosz Golaszewski authored
The release tarball building is currently broken because it looks for a file that no longer exists. Drop the LGPL-3.0 license file from EXTRA_DIST. Fixes: 76ecc337 ("licensing: relicense C++ bindings under LGPL-2.1-or-later") Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- May 07, 2024
-
-
Bartosz Golaszewski authored
Since kernel commit 840a97e2fbaf ("gpio: sim: delimit the fwnode name with a ":" when generating labels") the gpio-sim automatic labels are generated by delimiting the device name and the fwnode name with ':' instead of '-' for better readability. This will break the tests once linux v6.9 is out. Act in advance and accept both forms. Reviewed-by:
Kent Gibson <warthog618@gmail.com> Link: https://lore.kernel.org/r/20240506162506.176935-1-brgl@bgdev.pl Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-