From: Changqing Li <[email protected]>

Hardcode path will make run-ptest not work when package is installed
under /usr/lib64, error like:
ERROR: file or directory not found: /usr/lib/python3.*/site-packages/numpy

Signed-off-by: Changqing Li <[email protected]>
Signed-off-by: Mathieu Dubois-Briand <[email protected]>
Signed-off-by: Richard Purdie <[email protected]>
(cherry picked from commit 8a83d9cf127e28aecd3d737e20719c5e01d9c9cf)
Signed-off-by: Ankur Tyagi <[email protected]>
---
 meta/recipes-devtools/python/python3-numpy/run-ptest | 4 ++--
 meta/recipes-devtools/python/python3-numpy_2.3.4.bb  | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/python/python3-numpy/run-ptest 
b/meta/recipes-devtools/python/python3-numpy/run-ptest
index a1c80323d6..b5edc5cf48 100644
--- a/meta/recipes-devtools/python/python3-numpy/run-ptest
+++ b/meta/recipes-devtools/python/python3-numpy/run-ptest
@@ -5,7 +5,7 @@
 # the tests to report "no space left on device" errors. Create a custom
 # directory for these and point pytest at it so we can take advantage of the
 # storage provided in the rootfs.
-export PYTEST_DEBUG_TEMPROOT="/usr/lib/python3-numpy/ptest/tmp"
+export PYTEST_DEBUG_TEMPROOT="@PTEST_PATH@/tmp"
 mkdir -p "$PYTEST_DEBUG_TEMPROOT"
 
 # test_mem_policy fails if there's no C compiler present, but we don't want to
@@ -13,5 +13,5 @@ mkdir -p "$PYTEST_DEBUG_TEMPROOT"
 # large amount of storage, so skip that too.
 # remove test_validate_transcendentals if
 # https://github.com/numpy/numpy/issues/27460 is resolved
-pytest --automake -m "not slow" -k "not test_mem_policy and not 
test_big_arrays and not test_validate_transcendentals" 
/usr/lib/python3.*/site-packages/numpy
+pytest --automake -m "not slow" -k "not test_mem_policy and not 
test_big_arrays and not test_validate_transcendentals" 
@PYTHON_SITEPACKAGES_DIR@/numpy
 rm -rf "$PYTEST_DEBUG_TEMPROOT"
diff --git a/meta/recipes-devtools/python/python3-numpy_2.3.4.bb 
b/meta/recipes-devtools/python/python3-numpy_2.3.4.bb
index 7f82ca87a7..520c567bd4 100644
--- a/meta/recipes-devtools/python/python3-numpy_2.3.4.bb
+++ b/meta/recipes-devtools/python/python3-numpy_2.3.4.bb
@@ -39,6 +39,12 @@ do_install:append() {
     nativepython3 -mcompileall -s ${D} 
${D}${PYTHON_SITEPACKAGES_DIR}/numpy/__config__.py
 }
 
+do_install_ptest:append() {
+    sed -i \
+        -e 's|@PYTHON_SITEPACKAGES_DIR@|${PYTHON_SITEPACKAGES_DIR}|g' \
+        -e 's|@PTEST_PATH@|${PTEST_PATH}|g' ${D}${PTEST_PATH}/run-ptest
+}
+
 FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/_core/lib/*.a \
                           ${PYTHON_SITEPACKAGES_DIR}/numpy/random/lib/*.a \
 "
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#227674): 
https://lists.openembedded.org/g/openembedded-core/message/227674
Mute This Topic: https://lists.openembedded.org/mt/116760455/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to