All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ross Burton <ross.burton@arm.com>
To: openembedded-core@lists.openembedded.org
Cc: nd@arm.com
Subject: [RFC PATCH 00/10] Change Python package building to use picobuild
Date: Thu, 26 May 2022 18:09:51 +0100	[thread overview]
Message-ID: <20220526171001.4074388-1-ross.burton@arm.com> (raw)

Hi,

Currently we build modern Python packages by calling the PEP-517 API directly
(see python_pep517.bbclass, do_compile()). This mostly works, but sometimes
doesn't. For example we don't verify build dependencies, which led to the cbor2
ugprade silently failing to actually package anything. We should use a proper
build frontend which actually validates dependencies and does builds in the
correct manner.

The standard frontend is pypa/build, but for source-based distributions
that can be annoying to build as it depends on the following packages:

- tomli
- pep517
- packaging
- pyparsing

Manually bootstrapping those recipes is possible, but tedious.

Picobuild is another frontend (written by myself) which is designed
explicitly to be used programatically by source-based distributions: it
doesn't support builds inside virtual environments as we're building
distribution packages, and it vendors the dependencies for bootstrapping
if they're not available.

Over time more packages are expected to move to using Flit to build which makes
the bootstrapping process slightly easier, and tomli will be integrated into
Python 3.11, so it's possible that in the future we drop picobuild and switch to
build.  But for now, this works better than calling the API directly, and can be
fairly simply swapped out in the future if needed.

The impact is pretty minimal: the PEP517_BUILD_API variable is obsolete so can
be removed everywhere, and some recipes now fail because they have missing build
dependencies.  I've already fixed up the bulk of meta-oe in
meta-oe-contrib:ross/picobuild.  Most recipes don't need changes and just build
a little better now.

This works for me but could do with further testing, but this is primarily a RFC
because I'm about to leave on holiday for a week and then have a conference, so
I don't recommend merging this straight away!

Cheers,
Ross


Ross Burton (10):
  python3-pluggy: add BBCLASSEXTEND for native/nativesdk
  setuptools3: clean up class
  python3-flit-core: bootstrap explicitly
  python3-installer: bootstrap by installing installer with installer
  python3-pep517: add new recipe
  python3-setuptools-scm: DEPEND on python3-packaging
  python3-picobuild: add new recipe
  python_pep517: use picobuild instead of manually calling the API
  classes: remove obsolete PEP517_BUILD_API
  documentation: remove obsolete PEP517_BUILD_API

 documentation/ref-manual/classes.rst          |  4 +--
 documentation/ref-manual/variables.rst        |  5 ----
 meta/classes/python_flit_core.bbclass         |  5 +++-
 meta/classes/python_pep517.bbclass            |  8 ++----
 meta/classes/python_poetry_core.bbclass       |  2 --
 .../python_setuptools_build_meta.bbclass      |  2 --
 meta/classes/setuptools3.bbclass              |  5 ++--
 .../python/python3-flit-core_3.7.1.bb         |  6 ++++-
 .../python/python3-installer_0.5.1.bb         | 14 +++++++---
 .../python/python3-pep517_0.12.0.bb           | 10 +++++++
 .../python/python3-picobuild_0.1.bb           | 27 +++++++++++++++++++
 .../python/python3-pluggy_1.0.0.bb            |  2 ++
 .../python/python3-setuptools-scm_6.4.2.bb    |  2 +-
 13 files changed, 64 insertions(+), 28 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python3-pep517_0.12.0.bb
 create mode 100644 meta/recipes-devtools/python/python3-picobuild_0.1.bb

-- 
2.25.1



             reply	other threads:[~2022-05-26 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 17:09 Ross Burton [this message]
2022-05-26 17:09 ` [RFC PATCH 01/10] python3-pluggy: add BBCLASSEXTEND for native/nativesdk Ross Burton
2022-05-26 17:09 ` [RFC PATCH 02/10] setuptools3: clean up class Ross Burton
2022-05-26 17:09 ` [RFC PATCH 03/10] python3-flit-core: bootstrap explicitly Ross Burton
2022-05-26 17:09 ` [RFC PATCH 04/10] python3-installer: bootstrap by installing installer with installer Ross Burton
2022-05-26 17:09 ` [RFC PATCH 05/10] python3-pep517: add new recipe Ross Burton
2022-05-26 17:09 ` [RFC PATCH 06/10] python3-setuptools-scm: DEPEND on python3-packaging Ross Burton
2022-05-26 17:09 ` [RFC PATCH 07/10] python3-picobuild: add new recipe Ross Burton
2022-05-26 17:09 ` [RFC PATCH 08/10] python_pep517: use picobuild instead of manually calling the API Ross Burton
2022-05-26 17:10 ` [RFC PATCH 09/10] classes: remove obsolete PEP517_BUILD_API Ross Burton
2022-05-26 17:10 ` [RFC PATCH 10/10] documentation: " Ross Burton

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=20220526171001.4074388-1-ross.burton@arm.com \
    --to=ross.burton@arm.com \
    --cc=nd@arm.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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.