diff --git a/meta/classes-recipe/setuptools3.bbclass b/meta/classes-recipe/setuptools3.bbclass index d71a089539..64a78e9a36 100644 --- a/meta/classes-recipe/setuptools3.bbclass +++ b/meta/classes-recipe/setuptools3.bbclass @@ -12,6 +12,20 @@ SETUPTOOLS_BUILD_ARGS ?= "" 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 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_do_configure() { : }