Skip to content

Commit 8518985

Browse files
committed
clean up handling of binaries
1 parent 57c4cf7 commit 8518985

File tree

9 files changed

+12
-50
lines changed

9 files changed

+12
-50
lines changed

.evergreen/just.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
set -eu
33

44
. .evergreen/scripts/setup-dev-env.sh
5-
just "$@"
5+
${JUST_BINARY:-just} "$@"

.evergreen/run-tests.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ else
2525
exit 1
2626
fi
2727

28-
. $ROOT/.evergreen/utils.sh
29-
UV=$(get_uv)
28+
UV=${UV_BINARY:-uv}
3029

3130
# List the packages.
3231
$UV sync ${UV_ARGS} --reinstall

.evergreen/scripts/configure-env.sh

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,5 @@ DRIVERS_TOOLS: "$DRIVERS_TOOLS"
9191
PROJECT_DIRECTORY: "$PROJECT_DIRECTORY"
9292
EOT
9393

94-
# If the toolchain is available, symlink binaries to the bin dir. This has to be done
95-
# after drivers-tools is cloned, since we might be using its binary dir.
96-
_bin_path=""
97-
if [ "Windows_NT" == "${OS:-}" ]; then
98-
_bin_path="/cygdrive/c/Python/Current/Scripts"
99-
elif [ "$(uname -s)" != "Darwin" ]; then
100-
_bin_path="/Library/Frameworks/Python.Framework/Versions/Current/bin"
101-
else
102-
_bin_path="/opt/python/Current/bin"
103-
fi
104-
if [ -d "${_bin_path}" ]; then
105-
_suffix=""
106-
if [ "Windows_NT" == "${OS:-}" ]; then
107-
_suffix=".exe"
108-
fi
109-
mkdir -p $PYMONGO_BIN_DIR
110-
ln -s ${_bin_path}/just${_suffix} $PYMONGO_BIN_DIR/just${_suffix}
111-
ln -s ${_bin_path}/uv${_suffix} $PYMONGO_BIN_DIR/uv${_suffix}
112-
ln -s ${_bin_path}/uvx${_suffix} $PYMONGO_BIN_DIR/uvx${_suffix}
113-
fi
94+
# Handle the binary dependencies.
95+
bash $SCRIPT_DIR/install-dependencies.sh

.evergreen/scripts/install-dependencies.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,8 @@ if ! command -v uv >/dev/null 2>&1; then
8282
echo "Installing uv... done."
8383
fi
8484

85+
# Write the binary locations to the env file.
86+
echo "UV_BINARY=$(which uv)" >> $HERE/env.sh
87+
echo "JUST_BINARY=$(which uv)" >> $HERE/env.sh
88+
8589
popd > /dev/null

.evergreen/scripts/run-server.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@ if [ -f $HERE/env.sh ]; then
1010
source $HERE/env.sh
1111
fi
1212

13-
. $ROOT/.evergreen/utils.sh
14-
UV=$(get_uv)
15-
13+
UV=${UV_BINARY:-uv}
1614
$UV run $HERE/run_server.py "$@"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ if [ -f $HERE/test-env.sh ]; then
1717
fi
1818

1919
# Ensure dependencies are installed.
20-
bash $HERE/install-dependencies.sh
20+
export JUST
21+
JUST=$($HERE/install-dependencies.sh)
2122

2223
# Get the appropriate UV_PYTHON.
2324
. $ROOT/.evergreen/utils.sh

.evergreen/scripts/setup-system.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ echo "Setting up system..."
88
bash .evergreen/scripts/configure-env.sh
99
source .evergreen/scripts/env.sh
1010
bash $DRIVERS_TOOLS/.evergreen/setup.sh
11-
bash .evergreen/scripts/install-dependencies.sh
1211
popd
1312

1413
# Enable core dumps if enabled on the machine

.evergreen/scripts/setup-tests.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,5 @@ if [ -f $SCRIPT_DIR/env.sh ]; then
2020
source $SCRIPT_DIR/env.sh
2121
fi
2222

23-
. $ROOT/.evergreen/utils.sh
24-
UV=$(get_uv)
25-
23+
UV=${UV_BINARY:-uv}
2624
$UV run $SCRIPT_DIR/setup_tests.py "$@"

.evergreen/utils.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,3 @@ get_python_binary() {
138138
return 1
139139
fi
140140
}
141-
142-
143-
# Get the appropriate uv binary.
144-
get_uv() {
145-
# Try to use the binaries in the toolchain if available.
146-
if [ -f "/cygdrive/c/Python/Current/Scripts/uv.exe" ]; then
147-
echo "/cygdrive/c/Python/Current/Scripts/uv.exe"
148-
return
149-
fi
150-
if [ -f "/Library/Frameworks/Python.Framework/Versions/Current/bin/uv" ]; then
151-
echo "/Library/Frameworks/Python.Framework/Versions/Current/bin/uv"
152-
return
153-
fi
154-
if [ -f "/opt/python/Current/bin" ]; then
155-
echo "/opt/python/Current/bin/uv"
156-
return
157-
fi
158-
echo "$(which uv)"
159-
}

0 commit comments

Comments
 (0)