@@ -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() {
:
}
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 <ross.burton@arm.com> --- meta/classes-recipe/setuptools3_legacy.bbclass | 14 ++++++++++++++ 1 file changed, 14 insertions(+)