From 9a123bb631a268cdc6cac0f899e4d687ca7ea821 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 4 Mar 2025 09:14:10 -0600 Subject: [PATCH] PYTHON-5183 Fix C Extension building for Windows spawn hosts (#2178) --- .evergreen/scripts/setup-dev-env.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.evergreen/scripts/setup-dev-env.sh b/.evergreen/scripts/setup-dev-env.sh index f158c7132..d1c4be349 100755 --- a/.evergreen/scripts/setup-dev-env.sh +++ b/.evergreen/scripts/setup-dev-env.sh @@ -43,8 +43,18 @@ if [ -z "${PYMONGO_BIN_DIR:-}" ]; then export PATH="$PATH:$HOME/.local/bin" fi +# Set up venv, making sure c extensions build unless disabled. +if [ -z "${NO_EXT:-}" ]; then + export PYMONGO_C_EXT_MUST_BUILD=1 +fi +# Set up visual studio env on Windows spawn hosts. +if [ -f $HOME/.visualStudioEnv.sh ]; then + set +u + SSH_TTY=1 source $HOME/.visualStudioEnv.sh + set -u +fi uv sync --frozen -uv run --frozen --with pip pip install -e . + echo "Setting up python environment... done." # Ensure there is a pre-commit hook if there is a git checkout.