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() { : }