Thread (4 messages) 4 messages, 2 authors, 2022-12-07

Re: [libgpiod][PATCH 2/2] bindings: python: tests: set the process name

flat view

From: Bartosz Golaszewski <hidden>
Date: 2022-12-07 11:17:27

On Wed, 7 Dec 2022 at 11:57, Andy Shevchenko
[off-list ref] wrote:
On Wed, Dec 07, 2022 at 10:14:13AM +0100, Bartosz Golaszewski wrote:
quoted
From: Bartosz Golaszewski <redacted>

When we run the test suite by calling the __main__ function of the module,
the name of the process as visible in the system becomes "python". Let's
set it to "python-gpiod" before running the tests. This way gpiosim will
name its configfs attributes appropriately.
Perhaps you can refer to the [1] to explain why it's needed in Python.
Also it can be done via ctype module [2][3] or via module [4], although
I haven't checked if most used distros pack it.

[1]: https://bugs.python.org/issue5672
Sounds good, thanks. I'll add it as Link:.
[2]: https://stackoverflow.com/a/923034
[3]: https://stackoverflow.com/a/31134436
We're already using cpython C extensions so let's not mix multiple
different FFIs.
[4]: https://github.com/dvarrazzo/py-setproctitle
I was aware of this module, just don't want to pull third-party
requirements for python bindings if I don't need to.

Fun fact: the above C extension is a modified version of the code
generated by ChatGPT[1].

Bart

[1] https://imgur.com/a/SuDnyuO
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help