* [PATCH V2 0/3] fix .pyc/.pyo buildpaths issue
@ 2018-07-19 14:59 Hongxu Jia
2018-07-19 14:59 ` [PATCH 1/3] distutils/setuptools, distutils3/setuptools3: improve reproducibility Hongxu Jia
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Hongxu Jia @ 2018-07-19 14:59 UTC (permalink / raw)
To: openembedded-core, ross.burton
Changed in V2: Rebase to latest oe-core
The following changes since commit ff0b682b807959521c85716296de7a1d26d7d18f:
systemd-boot: upgrade to 239 (2018-07-18 10:13:30 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib hongxu/pyc-buildpath
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=hongxu/pyc-buildpath
Hongxu Jia (3):
distutils/setuptools, distutils3/setuptools3: improve reproducibility
python-setuptools.inc: clean up useless local
var-DISTUTILS_INSTALL_ARGS
python3-pip: clean up obsolete
meta/classes/distutils.bbclass | 8 +++++---
meta/classes/distutils3.bbclass | 8 +++++---
meta/classes/setuptools.bbclass | 5 -----
meta/classes/setuptools3.bbclass | 4 ----
meta/recipes-devtools/python/python-setuptools.inc | 3 ---
meta/recipes-devtools/python/python3-pip_10.0.1.bb | 18 ------------------
6 files changed, 10 insertions(+), 36 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/3] distutils/setuptools, distutils3/setuptools3: improve reproducibility
2018-07-19 14:59 [PATCH V2 0/3] fix .pyc/.pyo buildpaths issue Hongxu Jia
@ 2018-07-19 14:59 ` Hongxu Jia
2018-07-19 14:59 ` [PATCH 2/3] python-setuptools.inc: clean up useless local var-DISTUTILS_INSTALL_ARGS Hongxu Jia
2018-07-19 14:59 ` [PATCH 3/3] python3-pip: clean up obsolete Hongxu Jia
2 siblings, 0 replies; 4+ messages in thread
From: Hongxu Jia @ 2018-07-19 14:59 UTC (permalink / raw)
To: openembedded-core, ross.burton
- Unify var-DISTUTILS_INSTALL_ARGS in distutils and setuptools
- Supply "--root" directory to the "install" command, and use
it as a prefix to strip off the purported filename encoded
in bytecode files. (It strips build path prefix from .pyc files)
[YOCTO #8446]
[YOCTO #12084]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/classes/distutils.bbclass | 8 +++++---
meta/classes/distutils3.bbclass | 8 +++++---
meta/classes/setuptools.bbclass | 5 -----
meta/classes/setuptools3.bbclass | 4 ----
4 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index 1930c35..db28767 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -4,8 +4,10 @@ DISTUTILS_BUILD_ARGS ?= ""
DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
--install-data=${STAGING_DATADIR}"
-DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
- --install-data=${D}/${datadir}"
+DISTUTILS_INSTALL_ARGS ?= "--root=${D} \
+ --prefix=${prefix} \
+ --install-lib=${PYTHON_SITEPACKAGES_DIR} \
+ --install-data=${datadir}"
distutils_do_compile() {
STAGING_INCDIR=${STAGING_INCDIR} \
@@ -34,7 +36,7 @@ distutils_do_install() {
STAGING_INCDIR=${STAGING_INCDIR} \
STAGING_LIBDIR=${STAGING_LIBDIR} \
PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
- ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \
bbfatal_log "${PYTHON_PN} setup.py install execution failed."
# support filenames with *spaces*
diff --git a/meta/classes/distutils3.bbclass b/meta/classes/distutils3.bbclass
index d4b92a3..9637486 100644
--- a/meta/classes/distutils3.bbclass
+++ b/meta/classes/distutils3.bbclass
@@ -5,8 +5,10 @@ DISTUTILS_BUILD_EXT_ARGS ?= ""
DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
--install-data=${STAGING_DATADIR}"
-DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
- --install-data=${D}/${datadir}"
+DISTUTILS_INSTALL_ARGS ?= "--root=${D} \
+ --prefix=${prefix} \
+ --install-lib=${PYTHON_SITEPACKAGES_DIR} \
+ --install-data=${datadir}"
distutils3_do_configure() {
if [ "${CLEANBROKEN}" != "1" ] ; then
@@ -45,7 +47,7 @@ distutils3_do_install() {
STAGING_INCDIR=${STAGING_INCDIR} \
STAGING_LIBDIR=${STAGING_LIBDIR} \
PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
- ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \
bbfatal_log "${PYTHON_PN} setup.py install execution failed."
# support filenames with *spaces*
diff --git a/meta/classes/setuptools.bbclass b/meta/classes/setuptools.bbclass
index 157ef63..a923ea3 100644
--- a/meta/classes/setuptools.bbclass
+++ b/meta/classes/setuptools.bbclass
@@ -1,8 +1,3 @@
inherit distutils
DEPENDS += "python-setuptools-native"
-
-DISTUTILS_INSTALL_ARGS = "--root=${D} \
- --prefix=${prefix} \
- --install-lib=${PYTHON_SITEPACKAGES_DIR} \
- --install-data=${datadir}"
diff --git a/meta/classes/setuptools3.bbclass b/meta/classes/setuptools3.bbclass
index de6dd94..8ca66ee 100644
--- a/meta/classes/setuptools3.bbclass
+++ b/meta/classes/setuptools3.bbclass
@@ -2,7 +2,3 @@ inherit distutils3
DEPENDS += "python3-setuptools-native"
-DISTUTILS_INSTALL_ARGS = "--root=${D} \
- --prefix=${prefix} \
- --install-lib=${PYTHON_SITEPACKAGES_DIR} \
- --install-data=${datadir}"
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/3] python-setuptools.inc: clean up useless local var-DISTUTILS_INSTALL_ARGS
2018-07-19 14:59 [PATCH V2 0/3] fix .pyc/.pyo buildpaths issue Hongxu Jia
2018-07-19 14:59 ` [PATCH 1/3] distutils/setuptools, distutils3/setuptools3: improve reproducibility Hongxu Jia
@ 2018-07-19 14:59 ` Hongxu Jia
2018-07-19 14:59 ` [PATCH 3/3] python3-pip: clean up obsolete Hongxu Jia
2 siblings, 0 replies; 4+ messages in thread
From: Hongxu Jia @ 2018-07-19 14:59 UTC (permalink / raw)
To: openembedded-core, ross.burton
Since unify var-DISTUTILS_INSTALL_ARGS in distutils and setuptools,
The local var-DISTUTILS_INSTALL_ARGS broke do_install
...
error: option --script-dir not recognized
ERROR: python3 setup.py install execution failed.
...
[YOCTO #8446]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/recipes-devtools/python/python-setuptools.inc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/meta/recipes-devtools/python/python-setuptools.inc b/meta/recipes-devtools/python/python-setuptools.inc
index ab1c013..6dd772d 100644
--- a/meta/recipes-devtools/python/python-setuptools.inc
+++ b/meta/recipes-devtools/python/python-setuptools.inc
@@ -13,9 +13,6 @@ SRC_URI[sha256sum] = "012adb8e25fbfd64c652e99e7bab58799a3aaf05d39ab38561f69190a9
DEPENDS += "${PYTHON_PN}"
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR} \
- --script-dir=${bindir}"
-
RDEPENDS_${PN} = "\
${PYTHON_PN}-compile \
${PYTHON_PN}-compression \
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 3/3] python3-pip: clean up obsolete
2018-07-19 14:59 [PATCH V2 0/3] fix .pyc/.pyo buildpaths issue Hongxu Jia
2018-07-19 14:59 ` [PATCH 1/3] distutils/setuptools, distutils3/setuptools3: improve reproducibility Hongxu Jia
2018-07-19 14:59 ` [PATCH 2/3] python-setuptools.inc: clean up useless local var-DISTUTILS_INSTALL_ARGS Hongxu Jia
@ 2018-07-19 14:59 ` Hongxu Jia
2 siblings, 0 replies; 4+ messages in thread
From: Hongxu Jia @ 2018-07-19 14:59 UTC (permalink / raw)
To: openembedded-core, ross.burton
Since unify var-DISTUTILS_INSTALL_ARGS in distutils and setuptools,
- The local DISTUTILS_INSTALL_ARGS assignment is obsolete;
- The site.py is not be generated any more;
- The layout is in a standard pip dir (such as /usr/lib/python3.5/site-
packages/pip rather than /lib/python3.5/site-packages/pip-10.0.1-
py3.5.egg/pip), the pth file is not required;
`#!/usr/bin/env python3' is already used, do not manually sed.
[YOCTO #8446]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/recipes-devtools/python/python3-pip_10.0.1.bb | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/meta/recipes-devtools/python/python3-pip_10.0.1.bb b/meta/recipes-devtools/python/python3-pip_10.0.1.bb
index 100d4d0..8deec2b 100644
--- a/meta/recipes-devtools/python/python3-pip_10.0.1.bb
+++ b/meta/recipes-devtools/python/python3-pip_10.0.1.bb
@@ -11,27 +11,9 @@ SRC_URI[sha256sum] = "f2bd08e0cd1b06e10218feaf6fef299f473ba706582eb3bd9d52203fdb
inherit pypi distutils3
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR}"
-
-do_install_prepend() {
- install -d ${D}${PYTHON_SITEPACKAGES_DIR}
-}
-
-# Use setuptools site.py instead, avoid shared state issue
do_install_append() {
- rm ${D}${PYTHON_SITEPACKAGES_DIR}/site.py
- rm ${D}${PYTHON_SITEPACKAGES_DIR}/__pycache__/site.cpython-*.pyc
-
# Install as pip3 and leave pip2 as default
rm ${D}/${bindir}/pip
-
- # Installed eggs need to be passed directly to the interpreter via a pth file
- echo "./${PYPI_PACKAGE}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/${PYPI_PACKAGE}-${PV}.pth
-
- # Make sure we use /usr/bin/env python3
- for PYTHSCRIPT in `grep -rIl ${bindir} ${D}${bindir}/pip3*`; do
- sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
- done
}
RDEPENDS_${PN} = "\
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-19 14:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-19 14:59 [PATCH V2 0/3] fix .pyc/.pyo buildpaths issue Hongxu Jia
2018-07-19 14:59 ` [PATCH 1/3] distutils/setuptools, distutils3/setuptools3: improve reproducibility Hongxu Jia
2018-07-19 14:59 ` [PATCH 2/3] python-setuptools.inc: clean up useless local var-DISTUTILS_INSTALL_ARGS Hongxu Jia
2018-07-19 14:59 ` [PATCH 3/3] python3-pip: clean up obsolete Hongxu Jia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox