From bb01654e364fafe485449abb547592c84af6e242 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 1 May 2025 19:10:13 -0500 Subject: [PATCH 1/4] PYTHON-5365 Fix handing of remote tests --- .evergreen/scripts/install-dependencies.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index ec389690ca..f0f282410e 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -10,6 +10,9 @@ if [ -f $HERE/env.sh ]; then . $HERE/env.sh fi +# Set a default bin directory. +PYMONGO_BIN_DIR="${PYMONGO_BIN_DIR:-$HOME/.local/bin}" + # Helper function to pip install a dependency using a temporary python env. function _pip_install() { _HERE=$(dirname ${BASH_SOURCE:-$0}) @@ -41,10 +44,6 @@ 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 _BIN_DIR=$PYMONGO_BIN_DIR echo "Installing just..." mkdir -p "$_BIN_DIR" 2>/dev/null || true @@ -56,10 +55,6 @@ 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 _BIN_DIR=$PYMONGO_BIN_DIR echo "Installing uv..." # On most systems we can install directly. From cf78396895eec4384dc828f87fecd3939f385790 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 1 May 2025 20:24:38 -0500 Subject: [PATCH 2/4] fix handling of bin dir --- .evergreen/scripts/install-dependencies.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index f0f282410e..5425d10c8c 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -10,8 +10,11 @@ if [ -f $HERE/env.sh ]; then . $HERE/env.sh fi -# Set a default bin directory. -PYMONGO_BIN_DIR="${PYMONGO_BIN_DIR:-$HOME/.local/bin}" +# Set up the default bin directory. +if [ -z "${PYMONGO_BIN_DIR:-}" ]; then + PYMONGO_BIN_DIR="$HOME/.local/bin" + export PATH="$PYMONGO_BIN_DIR:$PATH" +fi # Helper function to pip install a dependency using a temporary python env. function _pip_install() { From f75dfa00698a43f4c111ce209e19420d26779e9c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 1 May 2025 20:38:08 -0500 Subject: [PATCH 3/4] fix git commit --- .evergreen/scripts/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/utils.py b/.evergreen/scripts/utils.py index c9195b638a..7a8f9640f8 100644 --- a/.evergreen/scripts/utils.py +++ b/.evergreen/scripts/utils.py @@ -193,6 +193,6 @@ def run_command(cmd: str | list[str], **kwargs: Any) -> None: def create_archive() -> str: run_command("git add .", cwd=ROOT) - run_command('git commit -m "add files"', check=False, cwd=ROOT) + run_command('git commit --no-verify -m "add files"', check=False, cwd=ROOT) run_command(f"git archive -o {TMP_DRIVER_FILE} HEAD", cwd=ROOT) return TMP_DRIVER_FILE From 776e751a288538d617bf1e9c57c393e9322952ca Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 2 May 2025 08:42:22 -0500 Subject: [PATCH 4/4] update contrib guide --- CONTRIBUTING.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 369e688b1e..e0b6260e21 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -231,6 +231,17 @@ the pages will re-render and the browser will automatically refresh. - Run `just setup-tests encryption`. - Run the tests with `just run-tests`. +To test with `encryption` and `PyOpenSSL`, use `just setup-tests encryption pyopenssl`. + +### PyOpenSSL tests + +- Run `just run-server` to start the server. +- Run `just setup-tests default_sync pyopenssl`. +- Run the tests with `just run-tests`. + +Note: `PyOpenSSL` is not used in async tests, but you can use `just setup-tests default_async pyopenssl` +to verify that PyMongo falls back to the standard library `OpenSSL`. + ### Load balancer tests - Install `haproxy` (available as `brew install haproxy` on macOS).