summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2022-02-22 11:16:33 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-25 15:06:46 +0000
commit082fb72ed1683a699ef4bc2c92aa987ce9c46509 (patch)
tree3cc347f1dd127b22db003ac95b2fb61df9021248
parentb8f25c75f152683de4fa6c176118583d3dea894d (diff)
downloadopenembedded-core-contrib-082fb72ed1683a699ef4bc2c92aa987ce9c46509.tar.gz
python3-pip: inherit setuptools_build_meta
Upstream provides a pyproject.toml which declares setuptools.build_meta as the backend for PEP-517 packaging. We bootstrap the -native installation by simply unzipping the wheel to PYTHON_SITEPACKAGES_DIR, so that all other recipes can use pip to install wheels (as intended by upstream). Check for presence of ${D}${bindir}/pip and remove if found (this was originally to make sure Python2 pip was the default). [YOCTO #14638] Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/python/python3-pip_22.0.3.bb19
1 files changed, 17 insertions, 2 deletions
diff --git a/meta/recipes-devtools/python/python3-pip_22.0.3.bb b/meta/recipes-devtools/python/python3-pip_22.0.3.bb
index 889a6bf8ad..c4671f5017 100644
--- a/meta/recipes-devtools/python/python3-pip_22.0.3.bb
+++ b/meta/recipes-devtools/python/python3-pip_22.0.3.bb
@@ -4,17 +4,32 @@ SECTION = "devel/python"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=63ec52baf95163b597008bb46db68030"
+inherit pypi setuptools_build_meta
+
DEPENDS += "python3 python3-setuptools-native"
-inherit pypi setuptools3
+# To avoid a dependency loop; we bootstrap -native
+DEPENDS:remove:class-native = "python3-pip-native"
+DEPENDS:append:class-native = " unzip-native"
SRC_URI += "file://0001-change-shebang-to-python3.patch"
SRC_URI[sha256sum] = "f29d589df8c8ab99c060e68ad294c4a9ed896624f6368c5349d70aa581b333d0"
+PYPA_WHEEL ?= "${B}/dist/${PYPI_PACKAGE}-${PV}-*.whl"
+
+do_install:class-native() {
+ # Bootstrap to prevent dependency loop in python3-pip-native
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+ unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PYPA_WHEEL} || \
+ bbfatal_log "Failed to unzip wheel: ${PYPA_WHEEL}. Check the logs."
+}
+
do_install:append() {
# Install as pip3 and leave pip2 as default
- rm ${D}/${bindir}/pip
+ if [ -e ${D}/${bindir}/pip ]; then
+ rm ${D}/${bindir}/pip
+ fi
}
RDEPENDS:${PN} = "\