mirror of
https://git.yoctoproject.org/poky
synced 2026-07-27 07:27:12 +00:00
pip_install_wheel: add a generic do_install for bootstrapping
Several recipes are duplicating the same bootstrap logic for installing a wheel without using any tools. Add an implementation to pip_install_wheel to centralise the code, and remove the duplicated code from the following recipes: - python3-flit-core - python3-pip - python3-setuptools - python3-wheel (From OE-Core rev: d5d702a2cd06f863340f8e4cdce0904c9d86384d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7f1c3b4202
commit
5331d29a89
@@ -40,4 +40,10 @@ pip_install_wheel_do_install () {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# A manual do_install that just uses unzip for bootstrapping purposes. Callers should DEPEND on unzip-native.
|
||||||
|
pip_install_wheel_do_bootstrap_install () {
|
||||||
|
install -d ${D}${PYTHON_SITEPACKAGES_DIR}
|
||||||
|
unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PIP_INSTALL_DIST_PATH}/*.whl
|
||||||
|
}
|
||||||
|
|
||||||
EXPORT_FUNCTIONS do_install
|
EXPORT_FUNCTIONS do_install
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ PEP517_SOURCE_PATH = "${S}/flit_core"
|
|||||||
PIP_INSTALL_PACKAGE = "flit_core"
|
PIP_INSTALL_PACKAGE = "flit_core"
|
||||||
|
|
||||||
do_install:class-native () {
|
do_install:class-native () {
|
||||||
install -d ${D}${PYTHON_SITEPACKAGES_DIR}
|
pip_install_wheel_do_bootstrap_install
|
||||||
unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PIP_INSTALL_DIST_PATH}/flit_core*.whl
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PACKAGES =+ "${PN}-tests"
|
PACKAGES =+ "${PN}-tests"
|
||||||
|
|||||||
@@ -19,9 +19,7 @@ SRC_URI += "file://reproducible.patch"
|
|||||||
SRC_URI[sha256sum] = "f29d589df8c8ab99c060e68ad294c4a9ed896624f6368c5349d70aa581b333d0"
|
SRC_URI[sha256sum] = "f29d589df8c8ab99c060e68ad294c4a9ed896624f6368c5349d70aa581b333d0"
|
||||||
|
|
||||||
do_install:class-native() {
|
do_install:class-native() {
|
||||||
# Bootstrap to prevent dependency loop in python3-pip-native
|
pip_install_wheel_do_bootstrap_install
|
||||||
install -d ${D}${PYTHON_SITEPACKAGES_DIR}
|
|
||||||
unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PIP_INSTALL_DIST_PATH}/*.whl
|
|
||||||
|
|
||||||
# pip install would normally generate [console_scripts] in ${bindir}
|
# pip install would normally generate [console_scripts] in ${bindir}
|
||||||
install -d ${D}/${bindir}
|
install -d ${D}/${bindir}
|
||||||
|
|||||||
@@ -22,9 +22,7 @@ DEPENDS:remove:class-native = "python3-pip-native python3-setuptools-native"
|
|||||||
DEPENDS:append:class-native = " unzip-native"
|
DEPENDS:append:class-native = " unzip-native"
|
||||||
|
|
||||||
do_install:class-native() {
|
do_install:class-native() {
|
||||||
# Bootstrap to prevent dependency loop in python3-pip-native
|
pip_install_wheel_do_bootstrap_install
|
||||||
install -d ${D}${PYTHON_SITEPACKAGES_DIR}
|
|
||||||
unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PIP_INSTALL_DIST_PATH}/*.whl
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RDEPENDS:${PN} = "\
|
RDEPENDS:${PN} = "\
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ SRC_URI += " file://0001-Backport-pyproject.toml-from-flit-backend-branch.patch"
|
|||||||
DEPENDS:remove:class-native = "python3-pip-native"
|
DEPENDS:remove:class-native = "python3-pip-native"
|
||||||
|
|
||||||
do_install:class-native () {
|
do_install:class-native () {
|
||||||
# We need to bootstrap python3-wheel-native
|
pip_install_wheel_do_bootstrap_install
|
||||||
install -d ${D}${PYTHON_SITEPACKAGES_DIR}
|
|
||||||
unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PIP_INSTALL_DIST_PATH}/*.whl
|
|
||||||
|
|
||||||
# pip install would normally generate [project.scripts] in ${bindir}
|
# pip install would normally generate [project.scripts] in ${bindir}
|
||||||
install -d ${D}/${bindir}
|
install -d ${D}/${bindir}
|
||||||
|
|||||||
Reference in New Issue
Block a user