All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Kent Gibson <warthog618@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [libgpiod v2][PATCH v4 0/4] bindings: implement python bindings for libgpiod v2
Date: Mon, 31 Oct 2022 12:41:08 +0100	[thread overview]
Message-ID: <CAMRc=Md=RC3JO2OHZQb=yZ91DXiGyW-SkJe4tkmkSzveqG4dJw@mail.gmail.com> (raw)
In-Reply-To: <20221026123425.498912-1-brgl@bgdev.pl>

On Wed, Oct 26, 2022 at 2:34 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> This is the fourth iteration of python bindings for libgpiod v2.
>
> The code has been split into high-level python and low-level C layers
> with the latter only doing the bare minimum.
>
> The data model is mostly based on the C++ one with the main difference
> being utilizing dynamic typing and keyword arguments in place of the
> builder pattern. That allows us to reduce the number of methods and
> objects.
>
> Because python doesn't have RAII, unlike C++, we provide a module-level
> request_lines() helper as gpiod.Chip(path).request_lines(...) one-liner
> could lead to the chip left dangling even after the last reference is
> dropped.
>
> Because python forces us to dynamically allocate objects all the time even
> for fundamental types (which are also immutable) there's no point in trying
> to replicate the edge-event buffer. Instead LineRequest.read_edge_event()
> just returns a list of events.
>
> v3 -> v4:
> - use list and dict comprehensions where applicable
> - add a helper for detecting GPIO devices in examples
> - remove commented out code
> - fix whitespace errors
> - cache chip_info in the chip object
> - rename Chip.map_line() to Chip.line_name_from_id()
> - disallow repeating line offsets/names as well as offset-name conflicts in request configs
> - don't modify python objects with GIL released (self->chip assignment)
> - fix type conversion strings
> - fix error check in request_offsets()
> - fix type comparison warnings
>

I applied these patches, squashed the entire libgpiod v2 patchset to
preserve bisectability and pulled the entire thing into the master
branch. Let's continue the development from here. The new release is
definitely not done yet but let's just have some solid base to work
on.

Bart

      parent reply	other threads:[~2022-10-31 11:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 12:34 [libgpiod v2][PATCH v4 0/4] bindings: implement python bindings for libgpiod v2 Bartosz Golaszewski
2022-10-26 12:34 ` [libgpiod v2][PATCH v4 1/4] bindings: python: remove old version Bartosz Golaszewski
2022-10-26 12:34 ` [libgpiod v2][PATCH v4 2/4] bindings: python: add examples Bartosz Golaszewski
2022-10-26 12:53   ` Andy Shevchenko
2022-10-27  8:05     ` Bartosz Golaszewski
2022-10-26 12:34 ` [libgpiod v2][PATCH v4 3/4] bindings: python: add tests Bartosz Golaszewski
2022-10-26 12:34 ` [libgpiod v2][PATCH v4 4/4] bindings: python: implement python bindings for libgpiod v2 Bartosz Golaszewski
2022-10-31 11:41 ` Bartosz Golaszewski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMRc=Md=RC3JO2OHZQb=yZ91DXiGyW-SkJe4tkmkSzveqG4dJw@mail.gmail.com' \
    --to=brgl@bgdev.pl \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=warthog618@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.