diff mbox series

[1/2] classes/python_pep517: use Python's unzip module to manually install wheels

Message ID 20261202120138.2924660-1-ross.burton@arm.com
State Under Review
Headers show
Series [1/2] classes/python_pep517: use Python's unzip module to manually install wheels | expand

Commit Message

Ross Burton Dec. 2, 2026, 12:01 p.m. UTC
Instead of using unzip, we can use the Python zipfile module to unpack
the wheel. The non-bootstrap pypa/installer also uses this module, and
this way we don't depend on unzip-native.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes-recipe/python_pep517.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/python_pep517.bbclass b/meta/classes-recipe/python_pep517.bbclass
index a3c7d704d67..32155c718da 100644
--- a/meta/classes-recipe/python_pep517.bbclass
+++ b/meta/classes-recipe/python_pep517.bbclass
@@ -60,10 +60,10 @@  python_pep517_do_install () {
     find ${D} -path *.dist-info/RECORD -delete
 }
 
-# A manual do_install that just uses unzip for bootstrapping purposes. Callers should DEPEND on unzip-native.
+# A manual do_install that simply unpacks the wheel
 python_pep517_do_bootstrap_install () {
     install -d ${D}${PYTHON_SITEPACKAGES_DIR}
-    unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PEP517_WHEEL_PATH}/*.whl
+    python3 -m zipfile --extract ${PEP517_WHEEL_PATH}/*.whl ${D}${PYTHON_SITEPACKAGES_DIR}
 }
 
 EXPORT_FUNCTIONS do_configure do_compile do_install