[meta-python,2/9] poetry_core: add helper class

Message ID 20220301203354.3839755-2-tim.orling@konsulko.com
State New
Headers show
Series [meta-python,1/9] python3-poetry-core: add v1.0.8 | expand

Commit Message

Tim Orling March 1, 2022, 8:33 p.m. UTC
poetry.core.masonry.api is one of the common PEP-517 build backends.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 meta-python/classes/poetry_core.bbclass | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 meta-python/classes/poetry_core.bbclass

Patch

diff --git a/meta-python/classes/poetry_core.bbclass b/meta-python/classes/poetry_core.bbclass
new file mode 100644
index 0000000000..4b3f9631e2
--- /dev/null
+++ b/meta-python/classes/poetry_core.bbclass
@@ -0,0 +1,15 @@ 
+inherit pip_install_wheel python3native python3-dir setuptools3-base
+
+DEPENDS += "python3 python3-poetry-core-native python3-pip-native"
+
+do_configure () {
+    mkdir -p ${S}/dist
+    cat > ${S}/build-it.py << EOF
+from poetry.core.masonry import api
+api.build_wheel('${S}/dist')
+EOF
+}
+
+do_compile () {
+    ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} ${S}/build-it.py
+}