summaryrefslogtreecommitdiffstats
path: root/meta/classes/python_pep517.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/python_pep517.bbclass')
-rw-r--r--meta/classes/python_pep517.bbclass13
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/classes/python_pep517.bbclass b/meta/classes/python_pep517.bbclass
index ac7c1e44c6..83c6dcb5c7 100644
--- a/meta/classes/python_pep517.bbclass
+++ b/meta/classes/python_pep517.bbclass
@@ -6,6 +6,9 @@ DEPENDS:append = " python3-installer-native"
6# Where to execute the build process from 6# Where to execute the build process from
7PEP517_SOURCE_PATH ?= "${S}" 7PEP517_SOURCE_PATH ?= "${S}"
8 8
9# The PEP517 build API entry point
10PEP517_BUILD_API ?= "unset"
11
9# The directory where wheels should be written too. Build classes 12# The directory where wheels should be written too. Build classes
10# will ideally [cleandirs] this but we don't do that here in case 13# will ideally [cleandirs] this but we don't do that here in case
11# a recipe wants to install prebuilt wheels. 14# a recipe wants to install prebuilt wheels.
@@ -16,6 +19,14 @@ PEP517_INSTALL_PYTHON:class-native = "nativepython3"
16 19
17INSTALL_WHEEL_COMPILE_BYTECODE ?= "--compile-bytecode=0" 20INSTALL_WHEEL_COMPILE_BYTECODE ?= "--compile-bytecode=0"
18 21
22# When we have Python 3.11 we can parse pyproject.toml to determine the build
23# API entry point directly
24python_pep517_do_compile () {
25 cd ${PEP517_SOURCE_PATH}
26 nativepython3 -c "import ${PEP517_BUILD_API} as api; api.build_wheel('${PEP517_WHEEL_PATH}')"
27}
28do_compile[cleandirs] += "${PEP517_WHEEL_PATH}"
29
19python_pep517_do_install () { 30python_pep517_do_install () {
20 COUNT=$(find ${PEP517_WHEEL_PATH} -name '*.whl' | wc -l) 31 COUNT=$(find ${PEP517_WHEEL_PATH} -name '*.whl' | wc -l)
21 if test $COUNT -eq 0; then 32 if test $COUNT -eq 0; then
@@ -33,4 +44,4 @@ python_pep517_do_bootstrap_install () {
33 unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PEP517_WHEEL_PATH}/*.whl 44 unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PEP517_WHEEL_PATH}/*.whl
34} 45}
35 46
36EXPORT_FUNCTIONS do_install 47EXPORT_FUNCTIONS do_compile do_install