diff mbox series

python3: disable user site-pkg for native target

Message ID PR2PR09MB310088221E5A065A376AA985A8709@PR2PR09MB3100.eurprd09.prod.outlook.com
State Accepted, archived
Commit 71bf8e9e418af6213de17903f54502b5b1055872
Headers show
Series python3: disable user site-pkg for native target | expand

Commit Message

Konrad Weihmann Aug. 23, 2022, 7:03 a.m. UTC
by setting the ENABLE_USER_SITE flag globally.
This is the recommended way according to
https://peps.python.org/pep-0370/#implementation

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
---
 meta/recipes-devtools/python/python3_3.10.6.bb | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3_3.10.6.bb b/meta/recipes-devtools/python/python3_3.10.6.bb
index f19cd50273..1b28728732 100644
--- a/meta/recipes-devtools/python/python3_3.10.6.bb
+++ b/meta/recipes-devtools/python/python3_3.10.6.bb
@@ -171,6 +171,9 @@  do_install:append:class-native() {
         # Nothing should be looking into ${B} for python3-native
         sed -i -e 's:${B}:/build/path/unavailable/:g' \
                 ${D}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile
+        
+        # disable the lookup in user's site-packages globally
+        sed -i 's#ENABLE_USER_SITE = None#ENABLE_USER_SITE = False#' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
 }
 
 do_install:append() {