summaryrefslogtreecommitdiff
path: root/evergreen
diff options
context:
space:
mode:
authorJuan Gu <juan.gu@mongodb.com>2023-04-21 23:47:18 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-22 00:23:19 +0000
commit0a4aea3b6980c208e5d9f0256daba00133127c07 (patch)
treebb215d8a35dbbd6f59903d58f707096ee8763414 /evergreen
parentf1a77d1373badccf4bb111f83854f047f7ebde70 (diff)
downloadmongo-0a4aea3b6980c208e5d9f0256daba00133127c07.tar.gz
SERVER-75626 added venv site-packages path to sys.path at macos host
Diffstat (limited to 'evergreen')
-rw-r--r--evergreen/prelude_venv.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/evergreen/prelude_venv.sh b/evergreen/prelude_venv.sh
index 6b97a8a9cfb..e7dd4b9d57b 100644
--- a/evergreen/prelude_venv.sh
+++ b/evergreen/prelude_venv.sh
@@ -22,6 +22,11 @@ function activate_venv {
if [ "Windows_NT" = "$OS" ]; then
export PYTHONPATH="$PYTHONPATH;$(cygpath -w ${workdir}/src)"
+ elif [ "$(uname)" = "Darwin" ]; then
+ #SERVER-75626 After activating the virtual environment under the mocos host. the PYTHONPATH setting
+ #is incorrect, and the site-packages directory of the virtual environment cannot be found in the sys.path.
+ python_version=$($python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
+ export PYTHONPATH="${workdir}/venv/lib/python${python_version}/site-packages:${PYTHONPATH}:${workdir}/src"
else
export PYTHONPATH="$PYTHONPATH:${workdir}/src"
fi