From: Phil Howard <phil@gadgetoid.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Kent Gibson <warthog618@gmail.com>,
Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org, Phil Howard <phil@gadgetoid.com>
Subject: [libgpiod][PATCH 0/3] bindings: python: optionally include module (...)
Date: Wed, 11 Oct 2023 13:12:43 +0100 [thread overview]
Message-ID: <20231011121246.9467-1-phil@gadgetoid.com> (raw)
This changeset vendors the gpiod library into the Python package, adds
a pyproject.toml for minimum compatibility with modern Python packaging
standards and sets "python_requires" to 3.9, reflecting the minimum version
required by these bindings as established in commit <b436d05809b1> ("bindings:
python: replace PyModule_AddObjectRef() with PyModule_AddObject()").
Why?
So that setup.py can produce an sdist that is installable irrespective of the
availability or version of a distro-supplied libgpiod.
This prevents a libgpiod pypi package install balking because the distro
libgpiod is outdated or otherwise incompatible. This happens when attempting to
install the current libgpiod from pypi onto - for example - the Debian Bookworm
based Raspberry Pi OS.
The availability of a distro agnostic package also ensures that libgpiod can be
installed via pypi into an isolated virtual environment, safely specified as a
dependency for Python packages and allows Python developers to target the newest
API version irrespective of their distro supplied libgpiod.
This is essential, since a venv is now widely *required* for user Python
projects due to recommendations in pep-688 - https://peps.python.org/pep-0668/
For Raspberry Pi this sdist can also be converted into a precompiled wheel by
piwheels [1] which is, by default, added to Raspberry Pi OS as a pip index.
How?
If "USE_SYSTEM_GPIOD=1" is not specified then the gpiod._ext C Extension is
amended to include all of the C sources for gpiod, so it can be built as a
standalone module without depending upon a shared distro library.
The gpiod sources are included by symlinking the lib and include directories up
to the parent module, and updating MANIFEST.in to include the source files when
an sdist is built.
The resulting source distribution can then be uploaded to pypi and from there
can be built and installed by any user with python3-dev installed.
[1] - https://www.piwheels.org/
Phil Howard (3):
bindings: python: optionally include module in sdist
bindings: python: add pyproject.toml, pep 518
bindings: python: require python 3.9.0
bindings/python/MANIFEST.in | 4 +++
bindings/python/include | 1 +
bindings/python/lib | 1 +
bindings/python/pyproject.toml | 2 ++
bindings/python/setup.py | 58 ++++++++++++++++++++++++++--------
5 files changed, 53 insertions(+), 13 deletions(-)
create mode 120000 bindings/python/include
create mode 120000 bindings/python/lib
create mode 100644 bindings/python/pyproject.toml
--
2.34.1
next reply other threads:[~2023-10-11 12:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-11 12:12 Phil Howard [this message]
2023-10-11 12:12 ` [libgpiod][PATCH 1/3] bindings: python: optionally include module in sdist Phil Howard
2023-10-11 17:11 ` Andy Shevchenko
2023-10-12 9:03 ` Phil Howard
2023-10-12 19:18 ` Bartosz Golaszewski
2023-10-12 19:37 ` Bartosz Golaszewski
2023-10-11 12:12 ` [libgpiod][PATCH 2/3] bindings: python: add pyproject.toml, pep 518 Phil Howard
2023-10-12 19:10 ` Bartosz Golaszewski
2023-10-11 12:12 ` [libgpiod][PATCH 3/3] bindings: python: require python 3.9.0 Phil Howard
2023-10-12 19:07 ` Bartosz Golaszewski
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=20231011121246.9467-1-phil@gadgetoid.com \
--to=phil@gadgetoid.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).