From: Ross Burton Date: Tue, 29 Jul 2025 08:59:31 +0000 (+0100) Subject: setuptools3_legacy: add pyproject.toml check X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f524589f3d35475600954f5b27b4b74ea079e13c;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git setuptools3_legacy: add pyproject.toml check Copy the pyproject.toml check from setuptools3.bbclass so that the legacy class will also warn if there's a modern build framework available. Signed-off-by: Ross Burton Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/classes-recipe/setuptools3_legacy.bbclass b/meta/classes-recipe/setuptools3_legacy.bbclass index 8197f443c9..6b51b9796b 100644 --- a/meta/classes-recipe/setuptools3_legacy.bbclass +++ b/meta/classes-recipe/setuptools3_legacy.bbclass @@ -30,6 +30,20 @@ SETUPTOOLS_PYTHON:class-native = "nativepython3" SETUPTOOLS_SETUP_PATH ?= "${S}" +python do_check_backend() { + import re + filename = d.expand("${SETUPTOOLS_SETUP_PATH}/pyproject.toml") + if os.path.exists(filename): + for line in open(filename): + match = re.match(r"build-backend\s*=\s*\W([\w.]+)\W", line) + if not match: continue + + msg = f"inherits setuptools3_legacy but has pyproject.toml with {match[1]}, use the correct class" + if "pep517-backend" not in (d.getVar("INSANE_SKIP") or "").split(): + oe.qa.handle_error("pep517-backend", msg, d) +} +addtask check_backend after do_patch before do_configure + setuptools3_legacy_do_configure() { : }