Skip to content

Commit 02c3df6

Browse files
authored
PYTHON-5298 Update lock file and clean up dependency installation (#2317)
1 parent 9a2f567 commit 02c3df6

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.evergreen/scripts/configure-env.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ EOT
9696
_bin_path=""
9797
if [ "Windows_NT" == "${OS:-}" ]; then
9898
_bin_path="/cygdrive/c/Python/Current/Scripts"
99-
elif [ "$(uname -s)" != "Darwin" ]; then
99+
elif [ "$(uname -s)" == "Darwin" ]; then
100100
_bin_path="/Library/Frameworks/Python.Framework/Versions/Current/bin"
101101
else
102102
_bin_path="/opt/python/Current/bin"
@@ -106,6 +106,7 @@ if [ -d "${_bin_path}" ]; then
106106
if [ "Windows_NT" == "${OS:-}" ]; then
107107
_suffix=".exe"
108108
fi
109+
echo "Symlinking binaries from toolchain"
109110
mkdir -p $PYMONGO_BIN_DIR
110111
ln -s ${_bin_path}/just${_suffix} $PYMONGO_BIN_DIR/just${_suffix}
111112
ln -s ${_bin_path}/uv${_suffix} $PYMONGO_BIN_DIR/uv${_suffix}

.evergreen/scripts/install-dependencies.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ if [ -f $HERE/env.sh ]; then
1010
. $HERE/env.sh
1111
fi
1212

13-
_BIN_DIR=${PYMONGO_BIN_DIR:-$HOME/.local/bin}
14-
export PATH="$PATH:${_BIN_DIR}"
15-
1613
# Helper function to pip install a dependency using a temporary python env.
1714
function _pip_install() {
1815
_HERE=$(dirname ${BASH_SOURCE:-$0})
@@ -28,23 +25,27 @@ function _pip_install() {
2825
if [ "Windows_NT" = "${OS:-}" ]; then
2926
_suffix=".exe"
3027
fi
31-
ln -s "$(which $2)" $_BIN_DIR/${2}${_suffix}
28+
ln -s "$(which $2)" $PYMONGO_BIN_DIR/${2}${_suffix}
3229
# uv also comes with a uvx binary.
3330
if [ $2 == "uv" ]; then
34-
ln -s "$(which uvx)" $_BIN_DIR/uvx${_suffix}
31+
ln -s "$(which uvx)" $PYMONGO_BIN_DIR/uvx${_suffix}
3532
fi
36-
echo "Installed to ${_BIN_DIR}"
33+
echo "Installed to ${PYMONGO_BIN_DIR}"
3734
echo "Installing $2 using pip... done."
3835
}
3936

40-
4137
# Ensure just is installed.
42-
if ! command -v just >/dev/null 2>&1; then
38+
if ! command -v just &>/dev/null; then
4339
# On most systems we can install directly.
4440
_TARGET=""
4541
if [ "Windows_NT" = "${OS:-}" ]; then
4642
_TARGET="--target x86_64-pc-windows-msvc"
4743
fi
44+
if [ -z "${PYMONGO_BIN_DIR:-}" ]; then
45+
echo "Please install just!"
46+
exit 1
47+
fi
48+
_BIN_DIR=$PYMONGO_BIN_DIR
4849
echo "Installing just..."
4950
mkdir -p "$_BIN_DIR" 2>/dev/null || true
5051
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $_TARGET --to "$_BIN_DIR" || {
@@ -53,8 +54,13 @@ if ! command -v just >/dev/null 2>&1; then
5354
echo "Installing just... done."
5455
fi
5556

56-
# Install uv.
57-
if ! command -v uv >/dev/null 2>&1; then
57+
# Ensure uv is installed.
58+
if ! command -v uv &>/dev/null; then
59+
if [ -z "${PYMONGO_BIN_DIR:-}" ]; then
60+
echo "Please install uv!"
61+
exit 1
62+
fi
63+
_BIN_DIR=$PYMONGO_BIN_DIR
5864
echo "Installing uv..."
5965
# On most systems we can install directly.
6066
curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="$_BIN_DIR" INSTALLER_NO_MODIFY_PATH=1 sh || {

uv.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)