From 0e2934818123a3797d57273dfcb74829d07a79a3 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 11 Nov 2024 06:44:34 -0800 Subject: [PATCH 1/2] Prepend to PYTHONPATH in tests Preserve the existing PYTHONPATH by prepending instead of replacing. Signed-off-by: Steve Peters --- python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 98bbe66650..f7228de0a1 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -105,7 +105,7 @@ if (BUILD_TESTING) endif() set(_env_vars) - list(APPEND _env_vars "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/python/") + list(APPEND _env_vars "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/python/:$ENV{PYTHONPATH}") list(APPEND _env_vars "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}:$ENV{LD_LIBRARY_PATH}") set_tests_properties(${test} PROPERTIES ENVIRONMENT "${_env_vars}") From e52797994b3ec4f2ab751213f43c9a3afa520688 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 11 Nov 2024 08:31:53 -0800 Subject: [PATCH 2/2] fix python integration test as well Signed-off-by: Steve Peters --- test/integration/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/CMakeLists.txt b/test/integration/CMakeLists.txt index da422d2a89..df28287316 100644 --- a/test/integration/CMakeLists.txt +++ b/test/integration/CMakeLists.txt @@ -246,5 +246,5 @@ endif() if (TARGET INTEGRATION_python_system_loader) set_tests_properties(INTEGRATION_python_system_loader PROPERTIES - ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/python/") + ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/python/:$ENV{PYTHONPATH}") endif()