From 9d348182a091853dd960f6cc5c958e99fa662e55 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Thu, 24 Jul 2025 15:24:03 +0200 Subject: [PATCH] set PYTHONPATH where needed instead of globally setting it for everything --- pr_testing/_helper_functions.sh | 2 +- pr_testing/merge_cms-bot_pr.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pr_testing/_helper_functions.sh b/pr_testing/_helper_functions.sh index f330971cb0a0..516ee0c678a2 100755 --- a/pr_testing/_helper_functions.sh +++ b/pr_testing/_helper_functions.sh @@ -24,7 +24,7 @@ function get_cached_GH_JSON (){ # TODO retry if curl fails do to external glitch >&2 echo "Downloading PR ${PR}" for i in 0 1 2 3 4 ; do - ${CMSBOT_PYTHON_CMD} -c "import github_utils,json;data=github_utils.get_pr('${REPO}', '${PR_NR}');print(json.dumps(data))" > ${GH_JSON_PATH} || continue + PYTHONPATH=${PR_TESTING_DIR}/..${PYTHONPATH:+:$PYTHONPATH} ${CMSBOT_PYTHON_CMD} -c "import github_utils,json;data=github_utils.get_pr('${REPO}', '${PR_NR}');print(json.dumps(data))" > ${GH_JSON_PATH} || continue echo ${GH_JSON_PATH} break done diff --git a/pr_testing/merge_cms-bot_pr.sh b/pr_testing/merge_cms-bot_pr.sh index 981dfb014d97..c96df4fa2538 100755 --- a/pr_testing/merge_cms-bot_pr.sh +++ b/pr_testing/merge_cms-bot_pr.sh @@ -5,7 +5,6 @@ # Constants SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" # Absolute path to script CMS_BOT_DIR=$(dirname ${SCRIPTPATH}) # To get CMS_BOT dir path -export PYTHONPATH=$CMS_BOT_DIR:$PYTHONPATH PR_TESTING_DIR=${CMS_BOT_DIR}/pr_testing source ${PR_TESTING_DIR}/_helper_functions.sh # general helper functions