Skip to content

Commit 41f6c39

Browse files
committed
fix path handling
1 parent 324ad2b commit 41f6c39

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.evergreen/scripts/configure-env.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CARGO_HOME=${CARGO_HOME:-${DRIVERS_TOOLS}/.cargo}
1717
UV_TOOL_DIR=$PROJECT_DIRECTORY/.local/uv/tools
1818
UV_CACHE_DIR=$PROJECT_DIRECTORY/.local/uv/cache
1919
DRIVERS_TOOLS_BINARIES="$DRIVERS_TOOLS/.bin"
20+
MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
2021

2122
# On Evergreen jobs, "CI" will be set, and we don't want to write to $HOME.
2223
if [ "${CI:-}" == "true" ]; then
@@ -26,6 +27,8 @@ else
2627
PYMONGO_BIN_DIR=$HOME/cli_bin
2728
fi
2829

30+
PATH_EXT="$MONGODB_BINARIES:$DRIVERS_TOOLS_BINARIES:$PYMONGO_BIN_DIR:\$PATH"
31+
2932
# Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory
3033
if [ "Windows_NT" = "${OS:-}" ]; then # Magic variable in cygwin
3134
DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
@@ -34,6 +37,7 @@ if [ "Windows_NT" = "${OS:-}" ]; then # Magic variable in cygwin
3437
UV_TOOL_DIR=$(cygpath -m "$UV_TOOL_DIR")
3538
UV_CACHE_DIR=$(cygpath -m "$UV_CACHE_DIR")
3639
DRIVERS_TOOLS_BINARIES=$(cygpath -m "$DRIVERS_TOOLS_BINARIES")
40+
MONGODB_BINARIES=$(cygpath -m "$MONGODB_BINARIES")
3741
PYMONGO_BIN_DIR=$(cygpath -m "$PYMONGO_BIN_DIR")
3842
fi
3943

@@ -77,7 +81,7 @@ export UV_TOOL_DIR="$UV_TOOL_DIR"
7781
export UV_CACHE_DIR="$UV_CACHE_DIR"
7882
export UV_TOOL_BIN_DIR="$DRIVERS_TOOLS_BINARIES"
7983
export PYMONGO_BIN_DIR="$PYMONGO_BIN_DIR"
80-
export PATH="$MONGODB_BINARIES:$DRIVERS_TOOLS_BINARIES:$PYMONGO_BIN_DIR:$PATH"
84+
export PATH="$PATH_EXT"
8185
# shellcheck disable=SC2154
8286
export PROJECT="${project:-mongo-python-driver}"
8387
export PIP_QUIET=1

.evergreen/scripts/install-dependencies.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ function _pip_install() {
2424
echo "Installing $2 using pip..."
2525
createvirtualenv "$(find_python3)" $_VENV_PATH
2626
python -m pip install $1
27-
ln -s "$(which $2)" $_BIN_DIR/$2
27+
if [ "Windows_NT" = "${OS:-}" ]; then
28+
ln -s "$(which $2)" $_BIN_DIR/$2.exe
29+
else
30+
ln -s "$(which $2)" $_BIN_DIR/$2
31+
fi
2832
echo "Installed to ${_BIN_DIR}"
2933
echo "Installing $2 using pip... done."
3034
}
@@ -52,6 +56,9 @@ if ! command -v uv 2>/dev/null; then
5256
curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="$_BIN_DIR" INSTALLER_NO_MODIFY_PATH=1 sh || {
5357
_pip_install uv uv
5458
}
59+
if [ "Windows_NT" = "${OS:-}" ]; then
60+
chmod +x "$(cygpath -u $_BIN_DIR)/uv.exe"
61+
fi
5562
echo "Installing uv... done."
5663
fi
5764

.evergreen/scripts/setup-dev-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
set -eu
3+
set -eux
44

55
HERE=$(dirname ${BASH_SOURCE:-$0})
66
pushd "$(dirname "$(dirname $HERE)")" > /dev/null

0 commit comments

Comments
 (0)