diff options
author | Ross Burton <ross.burton@arm.com> | 2025-07-29 09:59:31 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-07-31 10:48:35 +0100 |
commit | 4c2e3f1a594fe323c5de1a4e88d4678b6d529c43 (patch) | |
tree | 2eaee17a312591976931d9550d7e9d1ce2b4112e | |
parent | f15ee6b09968a34d0b4ef21c85cc41f17dc155cc (diff) | |
download | poky-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.bbclass | 14 |
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 | ||
31 | SETUPTOOLS_SETUP_PATH ?= "${S}" | 31 | SETUPTOOLS_SETUP_PATH ?= "${S}" |
32 | 32 | ||
33 | python 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 | } | ||
45 | addtask check_backend after do_patch before do_configure | ||
46 | |||
33 | setuptools3_legacy_do_configure() { | 47 | setuptools3_legacy_do_configure() { |
34 | : | 48 | : |
35 | } | 49 | } |