From 550425cdb48d877be994b9ab6ddd2e42d5a9afa1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 27 Apr 2025 11:02:15 -0500 Subject: [PATCH 01/10] PYTHON-5298 Update lock file --- uv.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/uv.lock b/uv.lock index 6bc0839795..aa23663a84 100644 --- a/uv.lock +++ b/uv.lock @@ -998,7 +998,6 @@ sdist = { url = "https://files.pythonhosted.org/packages/07/e9/ae44ea7d7605df9e5 [[package]] name = "pymongo" -version = "4.13.0.dev0" source = { editable = "." } dependencies = [ { name = "dnspython" }, From 61dec3573bb6a0ed2443799801adf908d68dc66c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 27 Apr 2025 12:20:31 -0500 Subject: [PATCH 02/10] debug --- .evergreen/scripts/configure-env.sh | 2 ++ .evergreen/scripts/install-dependencies.sh | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.evergreen/scripts/configure-env.sh b/.evergreen/scripts/configure-env.sh index 81713f4191..058abcc058 100755 --- a/.evergreen/scripts/configure-env.sh +++ b/.evergreen/scripts/configure-env.sh @@ -106,6 +106,8 @@ if [ -d "${_bin_path}" ]; then if [ "Windows_NT" == "${OS:-}" ]; then _suffix=".exe" fi + echo "Symlinking binaries from toolchain" + echo "PATH_EXT=$PATH_EXT" mkdir -p $PYMONGO_BIN_DIR ln -s ${_bin_path}/just${_suffix} $PYMONGO_BIN_DIR/just${_suffix} ln -s ${_bin_path}/uv${_suffix} $PYMONGO_BIN_DIR/uv${_suffix} diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index 780d250a2b..561cd10248 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -10,6 +10,10 @@ if [ -f $HERE/env.sh ]; then . $HERE/env.sh fi +echo "PATH_EXT=$PATH_EXT" +echo "PATH=$PATH" +echo "PYMONGO_BIN_DIR=$PYMONGO_BIN_DIR" +exit 1 _BIN_DIR=${PYMONGO_BIN_DIR:-$HOME/.local/bin} export PATH="$PATH:${_BIN_DIR}" From b8910b392a382ae38ef0db32249c9ee118462227 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 27 Apr 2025 12:24:59 -0500 Subject: [PATCH 03/10] debug --- .evergreen/scripts/install-dependencies.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index 561cd10248..2fc3780556 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -5,13 +5,14 @@ set -eu HERE=$(dirname ${BASH_SOURCE:-$0}) pushd "$(dirname "$(dirname $HERE)")" > /dev/null +echo "before PATH=$PATH_EXT" + # Source the env files to pick up common variables. if [ -f $HERE/env.sh ]; then . $HERE/env.sh fi -echo "PATH_EXT=$PATH_EXT" -echo "PATH=$PATH" +echo "after PATH=$PATH" echo "PYMONGO_BIN_DIR=$PYMONGO_BIN_DIR" exit 1 _BIN_DIR=${PYMONGO_BIN_DIR:-$HOME/.local/bin} From 29597e6957a2b48e520e561a4f6eb6c7ed924d8d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 27 Apr 2025 12:31:14 -0500 Subject: [PATCH 04/10] debug --- .evergreen/scripts/install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index 2fc3780556..dcb46c5533 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -5,7 +5,7 @@ set -eu HERE=$(dirname ${BASH_SOURCE:-$0}) pushd "$(dirname "$(dirname $HERE)")" > /dev/null -echo "before PATH=$PATH_EXT" +echo "before PATH=$PATH" # Source the env files to pick up common variables. if [ -f $HERE/env.sh ]; then From e5ab2740ad9b2d76d9292f79a72d25aa2c20dbf0 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 27 Apr 2025 12:52:31 -0500 Subject: [PATCH 05/10] debug --- .evergreen/scripts/configure-env.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.evergreen/scripts/configure-env.sh b/.evergreen/scripts/configure-env.sh index 058abcc058..1627cbc5ca 100755 --- a/.evergreen/scripts/configure-env.sh +++ b/.evergreen/scripts/configure-env.sh @@ -93,6 +93,12 @@ EOT # If the toolchain is available, symlink binaries to the bin dir. This has to be done # after drivers-tools is cloned, since we might be using its binary dir. +set -x +ls /Library/Frameworks/Python.Framework/Versions/ +ls /Library/Frameworks/Python.Framework/Versions/Current +ls /Library/Frameworks/Python.Framework/Versions/Current/bin +exit 1 + _bin_path="" if [ "Windows_NT" == "${OS:-}" ]; then _bin_path="/cygdrive/c/Python/Current/Scripts" From 5389c3d2418cf1ad444da2b6f18bfb81f5ee3443 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 27 Apr 2025 14:39:57 -0500 Subject: [PATCH 06/10] cleanup --- .evergreen/scripts/configure-env.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.evergreen/scripts/configure-env.sh b/.evergreen/scripts/configure-env.sh index 1627cbc5ca..8dc328aab3 100755 --- a/.evergreen/scripts/configure-env.sh +++ b/.evergreen/scripts/configure-env.sh @@ -93,16 +93,10 @@ EOT # If the toolchain is available, symlink binaries to the bin dir. This has to be done # after drivers-tools is cloned, since we might be using its binary dir. -set -x -ls /Library/Frameworks/Python.Framework/Versions/ -ls /Library/Frameworks/Python.Framework/Versions/Current -ls /Library/Frameworks/Python.Framework/Versions/Current/bin -exit 1 - _bin_path="" if [ "Windows_NT" == "${OS:-}" ]; then _bin_path="/cygdrive/c/Python/Current/Scripts" -elif [ "$(uname -s)" != "Darwin" ]; then +elif [ "$(uname -s)" == "Darwin" ]; then _bin_path="/Library/Frameworks/Python.Framework/Versions/Current/bin" else _bin_path="/opt/python/Current/bin" @@ -113,7 +107,6 @@ if [ -d "${_bin_path}" ]; then _suffix=".exe" fi echo "Symlinking binaries from toolchain" - echo "PATH_EXT=$PATH_EXT" mkdir -p $PYMONGO_BIN_DIR ln -s ${_bin_path}/just${_suffix} $PYMONGO_BIN_DIR/just${_suffix} ln -s ${_bin_path}/uv${_suffix} $PYMONGO_BIN_DIR/uv${_suffix} From e914680d96faf482675276dc49711a83626565e1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 27 Apr 2025 14:50:49 -0500 Subject: [PATCH 07/10] cleanup --- .evergreen/scripts/install-dependencies.sh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index dcb46c5533..7425a0914f 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -5,19 +5,11 @@ set -eu HERE=$(dirname ${BASH_SOURCE:-$0}) pushd "$(dirname "$(dirname $HERE)")" > /dev/null -echo "before PATH=$PATH" - # Source the env files to pick up common variables. if [ -f $HERE/env.sh ]; then . $HERE/env.sh fi -echo "after PATH=$PATH" -echo "PYMONGO_BIN_DIR=$PYMONGO_BIN_DIR" -exit 1 -_BIN_DIR=${PYMONGO_BIN_DIR:-$HOME/.local/bin} -export PATH="$PATH:${_BIN_DIR}" - # Helper function to pip install a dependency using a temporary python env. function _pip_install() { _HERE=$(dirname ${BASH_SOURCE:-$0}) @@ -42,9 +34,8 @@ function _pip_install() { echo "Installing $2 using pip... done." } - # Ensure just is installed. -if ! command -v just >/dev/null 2>&1; then +if ! command -v just &>/dev/null; then # On most systems we can install directly. _TARGET="" if [ "Windows_NT" = "${OS:-}" ]; then @@ -58,8 +49,8 @@ if ! command -v just >/dev/null 2>&1; then echo "Installing just... done." fi -# Install uv. -if ! command -v uv >/dev/null 2>&1; then +# Ensure uv is installed. +if ! command -v uv &>/dev/null; then echo "Installing uv..." # On most systems we can install directly. curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="$_BIN_DIR" INSTALLER_NO_MODIFY_PATH=1 sh || { From e58c6c05548cbbf2f0a240d5d7c49b17087d9261 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 27 Apr 2025 15:05:02 -0500 Subject: [PATCH 08/10] fix non-toolchain usage --- .evergreen/scripts/install-dependencies.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index 7425a0914f..63b724dde6 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -25,12 +25,12 @@ function _pip_install() { if [ "Windows_NT" = "${OS:-}" ]; then _suffix=".exe" fi - ln -s "$(which $2)" $_BIN_DIR/${2}${_suffix} + ln -s "$(which $2)" $PYMONGO_BIN_DIR/${2}${_suffix} # uv also comes with a uvx binary. if [ $2 == "uv" ]; then - ln -s "$(which uvx)" $_BIN_DIR/uvx${_suffix} + ln -s "$(which uvx)" $PYMONGO_BIN_DIR/uvx${_suffix} fi - echo "Installed to ${_BIN_DIR}" + echo "Installed to ${PYMONGO_BIN_DIR}" echo "Installing $2 using pip... done." } From bc1037620ed438b414b239b0738faa208e57eb2a Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 27 Apr 2025 15:07:43 -0500 Subject: [PATCH 09/10] cleanup --- .evergreen/scripts/install-dependencies.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index 63b724dde6..a0238c2d5f 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -41,6 +41,10 @@ if ! command -v just &>/dev/null; then if [ "Windows_NT" = "${OS:-}" ]; then _TARGET="--target x86_64-pc-windows-msvc" fi + if [ -z "${PYMONGO_BIN_DIR:-}" ]; then + echo "Please install just!" + exit 1 + fi echo "Installing just..." mkdir -p "$_BIN_DIR" 2>/dev/null || true curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $_TARGET --to "$_BIN_DIR" || { @@ -51,6 +55,10 @@ fi # Ensure uv is installed. if ! command -v uv &>/dev/null; then + if [ -z "${PYMONGO_BIN_DIR:-}" ]; then + echo "Please install uv!" + exit 1 + fi echo "Installing uv..." # On most systems we can install directly. curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="$_BIN_DIR" INSTALLER_NO_MODIFY_PATH=1 sh || { From 36ccd4b7a9c15459a95f2e3702fa19f2983f4856 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 27 Apr 2025 15:13:47 -0500 Subject: [PATCH 10/10] fix non-toolchain usage --- .evergreen/scripts/install-dependencies.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index a0238c2d5f..ec389690ca 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -45,6 +45,7 @@ if ! command -v just &>/dev/null; then echo "Please install just!" exit 1 fi + _BIN_DIR=$PYMONGO_BIN_DIR echo "Installing just..." mkdir -p "$_BIN_DIR" 2>/dev/null || true curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $_TARGET --to "$_BIN_DIR" || { @@ -59,6 +60,7 @@ if ! command -v uv &>/dev/null; then echo "Please install uv!" exit 1 fi + _BIN_DIR=$PYMONGO_BIN_DIR echo "Installing uv..." # On most systems we can install directly. curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="$_BIN_DIR" INSTALLER_NO_MODIFY_PATH=1 sh || {