* [PATCH 1/4] python3-pip-native: install scripts in ${bindir}
@ 2022-02-23 22:09 Tim Orling
2022-02-23 22:09 ` [PATCH 2/4] python3-scons-native: drop from maintainers.inc Tim Orling
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Tim Orling @ 2022-02-23 22:09 UTC (permalink / raw)
To: openembedded-core; +Cc: Tim Orling
The naïve approach of simply unzipping the built wheel is not
sufficient. 'pip install' would normally have created the
[console_scripts] from entry-points.txt in ${D}${bindir}.
For bootstrapping purposes, hardcode the scripts and install them into
${D}${bindir}. Skip the ${bindir}/pip variant.
[YOCTO #14739]
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
.../python/python3-pip_22.0.3.bb | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
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 482a210ee99..5a77cb72d70 100644
--- a/meta/recipes-devtools/python/python3-pip_22.0.3.bb
+++ b/meta/recipes-devtools/python/python3-pip_22.0.3.bb
@@ -23,6 +23,23 @@ do_install:class-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."
+
+ # pip install would normally generate [console_scripts] in ${bindir}
+ install -d ${D}/${bindir}
+ # We will skip the ${bindir}/pip variant as we would just remove it in the do_install:append
+ cat << EOF >> ${D}/${bindir}/pip3 | tee ${D}/${bindir}/pip${PYTHON_BASEVERSION}
+#!/bin/sh
+'''exec' ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} "\$0" "\$@"
+' '''
+# -*- coding: utf-8 -*-
+import re
+import sys
+from pip._internal.cli.main import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
+EOF
+ chmod 0755 ${D}${bindir}/pip3 ${D}${bindir}/pip${PYTHON_BASEVERSION}
}
do_install:append() {
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/4] python3-scons-native: drop from maintainers.inc
2022-02-23 22:09 [PATCH 1/4] python3-pip-native: install scripts in ${bindir} Tim Orling
@ 2022-02-23 22:09 ` Tim Orling
2022-02-23 22:09 ` [PATCH 3/4] python3-flit-core: SUMMARY DESCRIPTION HOMEPAGE Tim Orling
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Tim Orling @ 2022-02-23 22:09 UTC (permalink / raw)
To: openembedded-core; +Cc: Tim Orling
The python3-scons and python3-scons-native recipes have been merged
into one.
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
meta/conf/distro/include/maintainers.inc | 1 -
1 file changed, 1 deletion(-)
diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 333685cd8b8..3fceb6701bb 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -635,7 +635,6 @@ RECIPE_MAINTAINER:pn-python3-rfc3986-validator = "Bruce Ashfield <bruce.ashfield
RECIPE_MAINTAINER:pn-python3-rfc3987 = "Bruce Ashfield <bruce.ashfield@gmail.com>"
RECIPE_MAINTAINER:pn-python3-ruamel-yaml = "Bruce Ashfield <bruce.ashfield@gmail.com>"
RECIPE_MAINTAINER:pn-python3-scons = "Tim Orling <tim.orling@konsulko.com>"
-RECIPE_MAINTAINER:pn-python3-scons-native = "Tim Orling <tim.orling@konsulko.com>"
RECIPE_MAINTAINER:pn-python3-setuptools = "Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>"
RECIPE_MAINTAINER:pn-python3-setuptools-scm = "Tim Orling <tim.orling@konsulko.com>"
RECIPE_MAINTAINER:pn-python3-six = "Zang Ruochen <zangrc.fnst@fujitsu.com>"
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/4] python3-flit-core: SUMMARY DESCRIPTION HOMEPAGE
2022-02-23 22:09 [PATCH 1/4] python3-pip-native: install scripts in ${bindir} Tim Orling
2022-02-23 22:09 ` [PATCH 2/4] python3-scons-native: drop from maintainers.inc Tim Orling
@ 2022-02-23 22:09 ` Tim Orling
2022-02-23 22:09 ` [PATCH 4/4] python3-wheel-native: install ${bindir}/wheel Tim Orling
2022-02-24 0:30 ` [OE-core] [PATCH 1/4] python3-pip-native: install scripts in ${bindir} Peter Kjellerstedt
3 siblings, 0 replies; 5+ messages in thread
From: Tim Orling @ 2022-02-23 22:09 UTC (permalink / raw)
To: openembedded-core; +Cc: Tim Orling
Add SUMMARY DESCRIPTION HOMEPAGE and BUGTRACKER definitions.
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
meta/recipes-devtools/python/python3-flit-core_3.6.0.bb | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/meta/recipes-devtools/python/python3-flit-core_3.6.0.bb b/meta/recipes-devtools/python/python3-flit-core_3.6.0.bb
index d0b88c3fa50..6dfacafd31c 100644
--- a/meta/recipes-devtools/python/python3-flit-core_3.6.0.bb
+++ b/meta/recipes-devtools/python/python3-flit-core_3.6.0.bb
@@ -1,3 +1,10 @@
+SUMMARY = "This provides a PEP 517 build backend for packages using Flit."
+DESCRIPTION = "This provides a PEP 517 build backend for packages using \
+Flit. The only public interface is the API specified by PEP 517, at \
+flit_core.buildapi."
+HOMEPAGE = "https://github.com/pypa/flit"
+BUGTRACKER = "https://github.com/pypa/flit/issues"
+
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=41eb78fa8a872983a882c694a8305f08"
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 4/4] python3-wheel-native: install ${bindir}/wheel
2022-02-23 22:09 [PATCH 1/4] python3-pip-native: install scripts in ${bindir} Tim Orling
2022-02-23 22:09 ` [PATCH 2/4] python3-scons-native: drop from maintainers.inc Tim Orling
2022-02-23 22:09 ` [PATCH 3/4] python3-flit-core: SUMMARY DESCRIPTION HOMEPAGE Tim Orling
@ 2022-02-23 22:09 ` Tim Orling
2022-02-24 0:30 ` [OE-core] [PATCH 1/4] python3-pip-native: install scripts in ${bindir} Peter Kjellerstedt
3 siblings, 0 replies; 5+ messages in thread
From: Tim Orling @ 2022-02-23 22:09 UTC (permalink / raw)
To: openembedded-core; +Cc: Tim Orling
pip install would normally install [project.scripts] to ${D}${bindir}
but our naïve bootstrapping only unzipps the wheel to
${D}${PYTHON_SITEPACKAGES_DIR}. Correct this by creating the equivalent
script in do_install:class-native
[YOCTO #14739]
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
.../python/python3-wheel_0.37.1.bb | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/meta/recipes-devtools/python/python3-wheel_0.37.1.bb b/meta/recipes-devtools/python/python3-wheel_0.37.1.bb
index c7354c9d982..91bff825097 100644
--- a/meta/recipes-devtools/python/python3-wheel_0.37.1.bb
+++ b/meta/recipes-devtools/python/python3-wheel_0.37.1.bb
@@ -18,6 +18,22 @@ do_install:class-native () {
PYPA_WHEEL="${B}/dist/${PYPI_PACKAGE}-${PV}-*.whl"
unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PYPA_WHEEL} || \
bbfatal_log "Failed to install"
+
+ # pip install would normally generate [project.scripts] in ${bindir}
+ install -d ${D}/${bindir}
+ cat << EOF >> ${D}/${bindir}/wheel
+#!/bin/sh
+'''exec' ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} "\$0" "\$@"
+' '''
+# -*- coding: utf-8 -*-
+import re
+import sys
+from wheel.cli import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
+EOF
+ chmod 0755 ${D}${bindir}/wheel
}
BBCLASSEXTEND = "native nativesdk"
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* RE: [OE-core] [PATCH 1/4] python3-pip-native: install scripts in ${bindir}
2022-02-23 22:09 [PATCH 1/4] python3-pip-native: install scripts in ${bindir} Tim Orling
` (2 preceding siblings ...)
2022-02-23 22:09 ` [PATCH 4/4] python3-wheel-native: install ${bindir}/wheel Tim Orling
@ 2022-02-24 0:30 ` Peter Kjellerstedt
3 siblings, 0 replies; 5+ messages in thread
From: Peter Kjellerstedt @ 2022-02-24 0:30 UTC (permalink / raw)
To: Tim Orling, openembedded-core@lists.openembedded.org; +Cc: Tim Orling
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Tim Orling
> Sent: den 23 februari 2022 23:09
> To: openembedded-core@lists.openembedded.org
> Cc: Tim Orling <tim.orling@konsulko.com>
> Subject: [OE-core] [PATCH 1/4] python3-pip-native: install scripts in
> ${bindir}
>
> The naïve approach of simply unzipping the built wheel is not
> sufficient. 'pip install' would normally have created the
> [console_scripts] from entry-points.txt in ${D}${bindir}.
>
> For bootstrapping purposes, hardcode the scripts and install them into
> ${D}${bindir}. Skip the ${bindir}/pip variant.
>
> [YOCTO #14739]
>
> Signed-off-by: Tim Orling <tim.orling@konsulko.com>
> ---
> .../python/python3-pip_22.0.3.bb | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> 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 482a210ee99..5a77cb72d70 100644
> --- a/meta/recipes-devtools/python/python3-pip_22.0.3.bb
> +++ b/meta/recipes-devtools/python/python3-pip_22.0.3.bb
> @@ -23,6 +23,23 @@ do_install:class-native() {
For the record, OE-Core uses tabs to indent shell code,
compared to OpenEmbedded, which uses four spaces...
> install -d ${D}${PYTHON_SITEPACKAGES_DIR}
> unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PYPA_WHEEL} || \
There is no reason for the backslash at the end of the line above.
However, the line below should be indented to indicate that it is
a continuation of the line above,
> bbfatal_log "Failed to unzip wheel: ${PYPA_WHEEL}. Check the logs."
> +
> + # pip install would normally generate [console_scripts] in ${bindir}
> + install -d ${D}/${bindir}
Change "${D}/${bindir}" to "${D}${bindir}".
> + # We will skip the ${bindir}/pip variant as we would just remove it in the do_install:append
> + cat << EOF >> ${D}/${bindir}/pip3 | tee ${D}/${bindir}/pip${PYTHON_BASEVERSION}
Change the above to:
cat << EOF > pip3
or even better would be:
cat <<-EOF > pip3
as you then can indent the code below.
And the creation of the file belongs in do_compile:class-native()
instead.
> +#!/bin/sh
> +'''exec' ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} "\$0" "\$@"
> +' '''
What's the reason for the above construct? Why doesn't this work:
#!${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}
If it doesn't, then there should be a comment explaining what's
going on.
> +# -*- coding: utf-8 -*-
> +import re
> +import sys
> +from pip._internal.cli.main import main
> +if __name__ == '__main__':
> + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
> + sys.exit(main())
> +EOF
Isn't the code for pip3 available somewhere in the source code
so it could be copied from there instead? What happens if
upstream decides to change the implementation of pip3?
> + chmod 0755 ${D}${bindir}/pip3 ${D}${bindir}/pip${PYTHON_BASEVERSION}
Change the above to:
install pip3 ${D}${bindir}
install pip3 ${D}${bindir}/pip${PYTHON_BASEVERSION}
> }
>
> do_install:append() {
> --
> 2.30.2
Most of the above comments also apply to the patch for
python3-wheel-native.
//Peter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-02-24 0:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-23 22:09 [PATCH 1/4] python3-pip-native: install scripts in ${bindir} Tim Orling
2022-02-23 22:09 ` [PATCH 2/4] python3-scons-native: drop from maintainers.inc Tim Orling
2022-02-23 22:09 ` [PATCH 3/4] python3-flit-core: SUMMARY DESCRIPTION HOMEPAGE Tim Orling
2022-02-23 22:09 ` [PATCH 4/4] python3-wheel-native: install ${bindir}/wheel Tim Orling
2022-02-24 0:30 ` [OE-core] [PATCH 1/4] python3-pip-native: install scripts in ${bindir} Peter Kjellerstedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox