Skip to content

Commit

Permalink
Prepend to PYTHONPATH in tests (#2673) (#2681)
Browse files Browse the repository at this point in the history
Preserve the existing PYTHONPATH by prepending
instead of replacing.

Signed-off-by: Steve Peters <[email protected]>
(cherry picked from commit 0d346de)

Co-authored-by: Steve Peters <[email protected]>
  • Loading branch information
mergify[bot] and scpeters authored Nov 19, 2024
1 parent 9889df4 commit 1bbb645
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,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}")
Expand Down
2 changes: 1 addition & 1 deletion test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,5 +247,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()

0 comments on commit 1bbb645

Please sign in to comment.