python*native.bbclass: suppress user site dirs
PATCH 1/1 python*native.bbclass: suppress user site dirs
Currently, $HOME/.local is being added into sys.path for the native Python, causing subtle host contamination. Suppress this by exporting PYTHONNOUSERSITE = "1" as documented in PEP 370.
Signed-off-by Martin Kelly <[email protected]>
--- meta/classes/python3native.bbclass | 3 +++ meta/classes/pythonnative.bbclass | 3 +++ 2 files changed, 6 insertions(+)
meta/classes/python3native.bbclass +3 -0
@@ -9,5 +9,8 @@ DEPENDS_append = " ${PYTHON_PN}-native " export STAGING_INCDIR export STAGING_LIBDIR +# suppress host user's site-packages dirs. +export PYTHONNOUSERSITE = "1" + # autoconf macros will use their internal default preference otherwise export PYTHON
meta/classes/pythonnative.bbclass +3 -0
@@ -12,5 +12,8 @@ DEPENDS_append = " ${PYTHON_PN}-native " export STAGING_INCDIR export STAGING_LIBDIR +# suppress host user's site-packages dirs. +export PYTHONNOUSERSITE = "1" + # autoconf macros will use their internal default preference otherwise export PYTHON
Signature · 1 line
2.11.0
Quoted 4 lines · Martin Kelly
Currently, $HOME/.local is being added into sys.path for the native Python, causing subtle host contamination. Suppress this by exporting PYTHONNOUSERSITE = "1" as documented in PEP 370.
LGTM
Quoted 39 lines
Signed-off-by Martin Kelly <[email protected]>--- meta/classes/python3native.bbclass | 3 +++ meta/classes/pythonnative.bbclass | 3 +++ 2 files changed, 6 insertions(+)meta/classes/python3native.bbclass +3
-0@@ -9,5 +9,8 @@ DEPENDS_append = " ${PYTHON_PN}-native " export STAGING_INCDIR export STAGING_LIBDIR +# suppress host user's site-packages dirs. +export PYTHONNOUSERSITE = "1" + # autoconf macros will use their internal default preference otherwise export PYTHONmeta/classes/pythonnative.bbclass +3
-1@@ -12,5 +12,8 @@ DEPENDS_append = " ${PYTHON_PN}-native " export STAGING_INCDIR export STAGING_LIBDIR +# suppress host user's site-packages dirs. +export PYTHONNOUSERSITE = "1" + # autoconf macros will use their internal default preference otherwise export PYTHON --2.11.0