summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2025-07-29 09:59:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-07-31 10:48:35 +0100
commit4c2e3f1a594fe323c5de1a4e88d4678b6d529c43 (patch)
tree2eaee17a312591976931d9550d7e9d1ce2b4112e
parentf15ee6b09968a34d0b4ef21c85cc41f17dc155cc (diff)
downloadpoky-4c2e3f1a594fe323c5de1a4e88d4678b6d529c43.tar.gz
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. (From OE-Core rev: f524589f3d35475600954f5b27b4b74ea079e13c) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-recipe/setuptools3_legacy.bbclass14
1 files changed, 14 insertions, 0 deletions
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"
30 30
31SETUPTOOLS_SETUP_PATH ?= "${S}" 31SETUPTOOLS_SETUP_PATH ?= "${S}"
32 32
33python do_check_backend() {
34 import re
35 filename = d.expand("${SETUPTOOLS_SETUP_PATH}/pyproject.toml")
36 if os.path.exists(filename):
37 for line in open(filename):
38 match = re.match(r"build-backend\s*=\s*\W([\w.]+)\W", line)
39 if not match: continue
40
41 msg = f"inherits setuptools3_legacy but has pyproject.toml with {match[1]}, use the correct class"
42 if "pep517-backend" not in (d.getVar("INSANE_SKIP") or "").split():
43 oe.qa.handle_error("pep517-backend", msg, d)
44}
45addtask check_backend after do_patch before do_configure
46
33setuptools3_legacy_do_configure() { 47setuptools3_legacy_do_configure() {
34 : 48 :
35} 49}