From 62f0a0d0fe388a5b7d2293de1755c4ab414b6b4e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 06:35:00 -0600 Subject: [PATCH 01/25] PYTHON-4840 Add evergreen tests for free-threaded Python 3.13t --- .evergreen/generated_configs/variants.yml | 42 +++++++++++++++++++++++ .evergreen/scripts/generate_config.py | 14 ++++++++ 2 files changed, 56 insertions(+) diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index b77859bc91..dfa73e0da6 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -627,6 +627,48 @@ buildvariants: AUTH: auth PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 + # Free threaded tests + - name: free-threaded-rhel8-python3.13t + tasks: + - name: .8.0 .sharded_cluster .auth .ssl !.sync_async + - name: .8.0 .replica_set .noauth .ssl !.sync_async + - name: .8.0 .standalone .noauth .nossl !.sync_async + display_name: Free-threaded RHEL8 Python3.13t + run_on: + - rhel87-small + expansions: + PYTHON_BINARY: /opt/python/3.13t/bin/python3 + - name: free-threaded-macos-python3.13t + tasks: + - name: .8.0 .sharded_cluster .auth .ssl !.sync_async + - name: .8.0 .replica_set .noauth .ssl !.sync_async + - name: .8.0 .standalone .noauth .nossl !.sync_async + display_name: Free-threaded macOS Python3.13t + run_on: + - macos-14 + expansions: + PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3 + - name: free-threaded-macos-arm64-python3.13t + tasks: + - name: .8.0 .sharded_cluster .auth .ssl !.sync_async + - name: .8.0 .replica_set .noauth .ssl !.sync_async + - name: .8.0 .standalone .noauth .nossl !.sync_async + display_name: Free-threaded macOS Arm64 Python3.13t + run_on: + - macos-14-arm64 + expansions: + PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3 + - name: free-threaded-win64-python3.13t + tasks: + - name: .8.0 .sharded_cluster .auth .ssl !.sync_async + - name: .8.0 .replica_set .noauth .ssl !.sync_async + - name: .8.0 .standalone .noauth .nossl !.sync_async + display_name: Free-threaded Win64 Python3.13t + run_on: + - windows-64-vsMulti-small + expansions: + PYTHON_BINARY: C:/python/Python313t/python.exe + # Green framework tests - name: green-eventlet-rhel8-python3.9 tasks: diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 8a9ba8a206..dafd1163ae 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -152,6 +152,8 @@ def get_python_binary(python: str, host: Host) -> str: return f"/opt/python/{python}/bin/python3" if name in ["macos", "macos-arm64"]: + if python == "3.13t": + return "/Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3" return f"/Library/Frameworks/Python.Framework/Versions/{python}/bin/python3" raise ValueError(f"no match found for python {python} on {name}") @@ -318,6 +320,18 @@ def create_server_variants() -> list[BuildVariant]: return variants +def create_free_threaded_variants() -> list[BuildVariant]: + variants = [] + for host_name in ("rhel8", "macos", "macos-arm64", "win64"): + tasks = [f".8.0 {t} !.sync_async" for t in SUB_TASKS] + host = HOSTS[host_name] + python = "3.13t" + display_name = get_display_name("Free-threaded", host, python=python) + variant = create_variant(tasks, display_name, python=python, host=host) + variants.append(variant) + return variants + + def create_encryption_variants() -> list[BuildVariant]: variants = [] tags = ["encryption_tag"] From 1df6f243299393b01718e83e7f6b12bc4d009244 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 06:58:28 -0600 Subject: [PATCH 02/25] cleanup --- .evergreen/config.yml | 14 ++++++++++++++ .evergreen/generated_configs/variants.yml | 20 ++++++-------------- .evergreen/scripts/generate_config.py | 4 ++-- .evergreen/scripts/run-direct-tests.sh | 9 +++++++++ 4 files changed, 31 insertions(+), 16 deletions(-) create mode 100755 .evergreen/scripts/run-direct-tests.sh diff --git a/.evergreen/config.yml b/.evergreen/config.yml index aa0eee3620..f4abb9e98d 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -300,6 +300,11 @@ functions: - .evergreen/scripts/run-with-env.sh - .evergreen/scripts/run-tests.sh + "run direct tests": + - command: subprocess.exec + include_expansions_in_env: ["PYTHON_BINARY"] + args: [ .evergreen/scripts/run-direct-tests.sh ] + "run enterprise auth tests": - command: subprocess.exec type: test @@ -920,6 +925,15 @@ tasks: commands: - func: "run tests" + - name: "free-threading" + tags: ["free-threading"] + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "8.0" + TOPOLOGY: "replica_set" + - func: "run direct tests" + - name: "atlas-connect" tags: ["atlas-connect"] commands: diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index dfa73e0da6..caaa86ba18 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -630,9 +630,7 @@ buildvariants: # Free threaded tests - name: free-threaded-rhel8-python3.13t tasks: - - name: .8.0 .sharded_cluster .auth .ssl !.sync_async - - name: .8.0 .replica_set .noauth .ssl !.sync_async - - name: .8.0 .standalone .noauth .nossl !.sync_async + - name: .free-threading display_name: Free-threaded RHEL8 Python3.13t run_on: - rhel87-small @@ -640,29 +638,23 @@ buildvariants: PYTHON_BINARY: /opt/python/3.13t/bin/python3 - name: free-threaded-macos-python3.13t tasks: - - name: .8.0 .sharded_cluster .auth .ssl !.sync_async - - name: .8.0 .replica_set .noauth .ssl !.sync_async - - name: .8.0 .standalone .noauth .nossl !.sync_async + - name: .free-threading display_name: Free-threaded macOS Python3.13t run_on: - macos-14 expansions: - PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3 + PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3t - name: free-threaded-macos-arm64-python3.13t tasks: - - name: .8.0 .sharded_cluster .auth .ssl !.sync_async - - name: .8.0 .replica_set .noauth .ssl !.sync_async - - name: .8.0 .standalone .noauth .nossl !.sync_async + - name: .free-threading display_name: Free-threaded macOS Arm64 Python3.13t run_on: - macos-14-arm64 expansions: - PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3 + PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3t - name: free-threaded-win64-python3.13t tasks: - - name: .8.0 .sharded_cluster .auth .ssl !.sync_async - - name: .8.0 .replica_set .noauth .ssl !.sync_async - - name: .8.0 .standalone .noauth .nossl !.sync_async + - name: .free-threading display_name: Free-threaded Win64 Python3.13t run_on: - windows-64-vsMulti-small diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index dafd1163ae..123a120df3 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -153,7 +153,7 @@ def get_python_binary(python: str, host: Host) -> str: if name in ["macos", "macos-arm64"]: if python == "3.13t": - return "/Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3" + return "/Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3t" return f"/Library/Frameworks/Python.Framework/Versions/{python}/bin/python3" raise ValueError(f"no match found for python {python} on {name}") @@ -323,7 +323,7 @@ def create_server_variants() -> list[BuildVariant]: def create_free_threaded_variants() -> list[BuildVariant]: variants = [] for host_name in ("rhel8", "macos", "macos-arm64", "win64"): - tasks = [f".8.0 {t} !.sync_async" for t in SUB_TASKS] + tasks = [".free-threading"] host = HOSTS[host_name] python = "3.13t" display_name = get_display_name("Free-threaded", host, python=python) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh new file mode 100755 index 0000000000..1bad31f6b2 --- /dev/null +++ b/.evergreen/scripts/run-direct-tests.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +.evergreen/utils.sh + +createvirtualenv "$PYTHON_BINARY" .venv + +pip install -e ".[test]" + +pytest From 640a7dd36c6635370289518666e7c617f8bc38db Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 07:19:28 -0600 Subject: [PATCH 03/25] cleanup --- .evergreen/config.yml | 1 + .evergreen/scripts/run-direct-tests.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index f4abb9e98d..bdff002064 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -303,6 +303,7 @@ functions: "run direct tests": - command: subprocess.exec include_expansions_in_env: ["PYTHON_BINARY"] + binary: bash args: [ .evergreen/scripts/run-direct-tests.sh ] "run enterprise auth tests": diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index 1bad31f6b2..9f0d2d693e 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -2,6 +2,8 @@ .evergreen/utils.sh +. .evergreen/scripts/env.sh + createvirtualenv "$PYTHON_BINARY" .venv pip install -e ".[test]" From c4c4e2972b72a41dc9b81691ef80af8cc9a96183 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 07:24:56 -0600 Subject: [PATCH 04/25] cleanup --- .evergreen/config.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index bdff002064..52f3257ae8 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -302,9 +302,12 @@ functions: "run direct tests": - command: subprocess.exec - include_expansions_in_env: ["PYTHON_BINARY"] - binary: bash - args: [ .evergreen/scripts/run-direct-tests.sh ] + type: test + params: + working_dir: "src" + binary: bash + include_expansions_in_env: ["PYTHON_BINARY"] + args: [ .evergreen/scripts/run-direct-tests.sh ] "run enterprise auth tests": - command: subprocess.exec From 87988d5ce9210a71d74cfa184fa0684836df9d84 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 07:27:56 -0600 Subject: [PATCH 05/25] cleanup --- .evergreen/scripts/run-direct-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index 9f0d2d693e..f0108f491d 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -1,6 +1,6 @@ #!/bin/bash -.evergreen/utils.sh +. .evergreen/utils.sh . .evergreen/scripts/env.sh From a63052559e135aa5f6af2c353e125198d9c74b63 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 08:46:14 -0600 Subject: [PATCH 06/25] fix windows path --- .evergreen/generated_configs/variants.yml | 2 +- .evergreen/scripts/generate_config.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index caaa86ba18..fcca7f96b9 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -659,7 +659,7 @@ buildvariants: run_on: - windows-64-vsMulti-small expansions: - PYTHON_BINARY: C:/python/Python313t/python.exe + PYTHON_BINARY: C:/python/Python313/python3.13t.exe # Green framework tests - name: green-eventlet-rhel8-python3.9 diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 123a120df3..d0905cdb69 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -146,6 +146,8 @@ def get_python_binary(python: str, host: Host) -> str: else: base = "C:/python" python = python.replace(".", "") + if python == "313t": + return f"{base}/Python313/python3.13t.exe" return f"{base}/Python{python}/python.exe" if name in ["rhel8", "ubuntu22", "ubuntu20", "rhel7"]: From c469e7e944b3a45cee57f23ee227f9289e67c814 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 10:25:57 -0600 Subject: [PATCH 07/25] cleanup --- .evergreen/setup-spawn-host.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.evergreen/setup-spawn-host.sh b/.evergreen/setup-spawn-host.sh index 1a526c762c..4109e59183 100755 --- a/.evergreen/setup-spawn-host.sh +++ b/.evergreen/setup-spawn-host.sh @@ -8,7 +8,8 @@ if [ -z "$1" ] fi target=$1 -remote_dir=/home/ec2-user/mongo-python-driver +user=${target%@*} +remote_dir=/home/$user/mongo-python-driver echo "Copying files to $target..." rsync -az -e ssh --exclude '.git' --filter=':- .gitignore' -r . $target:$remote_dir From 8f455390956e2eaed0fc4c853e739c12e55dea12 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 10:34:14 -0600 Subject: [PATCH 08/25] debug --- .evergreen/scripts/run-direct-tests.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index f0108f491d..2bbedda6e0 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -8,4 +8,7 @@ createvirtualenv "$PYTHON_BINARY" .venv pip install -e ".[test]" -pytest +python --version +pytest --version + +pytest -v From 945376eac58ecc28dab9aea6d7fd468e0b1051c9 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 17:22:49 -0600 Subject: [PATCH 09/25] add core dumps --- .evergreen/config.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 52f3257ae8..97b09f7bc3 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -116,6 +116,29 @@ functions: content_type: text/html display_name: "Coverage Report HTML" + "upload core dumps": + - command: ec2.assume_role + params: + role_arn: ${assume_role_arn} + - command: archive.targz_pack + params: + target: "mongo-coredumps.tgz" + source_dir: ${PROJECT_DIRECTORY}/ + include: + - "./**.core" + - "./**.mdmp" # Windows: minidumps + - command: s3.put + params: + aws_key: ${AWS_ACCESS_KEY_ID} + aws_secret: ${AWS_SECRET_ACCESS_KEY} + aws_session_token: ${AWS_SESSION_TOKEN} + local_file: mongo-coredumps.tgz + remote_file: ${build_variant}/${revision}/${version_id}/${build_id}/coredumps/${task_id}-${execution}-mongodb-coredumps.tar.gz + bucket: ${bucket_name} + permissions: public-read + content_type: ${content_type|application/gzip} + display_name: Core Dumps - Execution + optional: true "upload mo artifacts": - command: ec2.assume_role @@ -645,6 +668,7 @@ post: - func: "teardown system" - func: "upload coverage" - func: "upload mo artifacts" + - func: "upload core dumps" - func: "upload test results" - func: "stop mongo-orchestration" - func: "cleanup" From 92b80721342e4ac7fb82273f05c7267197e89d1d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 17:44:40 -0600 Subject: [PATCH 10/25] debug --- .evergreen/scripts/run-direct-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index 2bbedda6e0..cff774db62 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -9,6 +9,7 @@ createvirtualenv "$PYTHON_BINARY" .venv pip install -e ".[test]" python --version +export PYTHONFAULTHANDLER=1 pytest --version pytest -v From ab451b8c1b5e3722dcaa00113e50c72bd93ee6e0 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 20:16:46 -0600 Subject: [PATCH 11/25] try with just pytest --- .evergreen/scripts/run-direct-tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index cff774db62..7a2ad2ed46 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -6,9 +6,10 @@ createvirtualenv "$PYTHON_BINARY" .venv -pip install -e ".[test]" +# pip install -e ".[test]" python --version +pip install pytest export PYTHONFAULTHANDLER=1 pytest --version From 4defea25a11badd0b7ef6a841ef98434390195aa Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 20:28:45 -0600 Subject: [PATCH 12/25] install ourselves as well --- .evergreen/scripts/run-direct-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index 7a2ad2ed46..68e00efb71 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -10,7 +10,7 @@ createvirtualenv "$PYTHON_BINARY" .venv python --version pip install pytest -export PYTHONFAULTHANDLER=1 +pip install -e . pytest --version pytest -v From 4a86e1677317824ee6e280afd6cf41cadd89d9e2 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 20:39:24 -0600 Subject: [PATCH 13/25] debug --- .evergreen/scripts/run-direct-tests.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index 68e00efb71..3150a34d20 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -7,10 +7,12 @@ createvirtualenv "$PYTHON_BINARY" .venv # pip install -e ".[test]" - +set -x python --version -pip install pytest +# pip install pytest pip install -e . -pytest --version +python -c "import pymongo" +python -c "import bson" +# pytest --version pytest -v From be7a6e1ed468cdd62be1b695d86ab3593dd69bd7 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 21:10:43 -0600 Subject: [PATCH 14/25] try without env --- .evergreen/scripts/run-direct-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index 3150a34d20..fca5ee2d12 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -2,7 +2,7 @@ . .evergreen/utils.sh -. .evergreen/scripts/env.sh +# . .evergreen/scripts/env.sh createvirtualenv "$PYTHON_BINARY" .venv From 1e11a5b4ea40314dccbc0bacf310ea1be6a89b1a Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 21:16:35 -0600 Subject: [PATCH 15/25] more debug --- .evergreen/scripts/run-direct-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index fca5ee2d12..a54dbe9ea2 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -10,7 +10,7 @@ createvirtualenv "$PYTHON_BINARY" .venv set -x python --version # pip install pytest -pip install -e . +pip install -v -e . python -c "import pymongo" python -c "import bson" # pytest --version From 4a30c05f5042df701e15682cd43f93d129fc4013 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 21:23:10 -0600 Subject: [PATCH 16/25] more debug --- .evergreen/scripts/run-direct-tests.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index a54dbe9ea2..0337055ff6 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -1,16 +1,17 @@ #!/bin/bash - +set -x . .evergreen/utils.sh # . .evergreen/scripts/env.sh - +ls pymongo createvirtualenv "$PYTHON_BINARY" .venv - +ls pymongo # pip install -e ".[test]" -set -x + python --version # pip install pytest pip install -v -e . +ls pymongo python -c "import pymongo" python -c "import bson" # pytest --version From 9394a774faaf2f6e3e66232dbcd8dfb54630da0a Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 3 Jan 2025 21:43:52 -0600 Subject: [PATCH 17/25] try setting ulimit --- .evergreen/scripts/run-direct-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index 0337055ff6..4cff866406 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -7,7 +7,7 @@ ls pymongo createvirtualenv "$PYTHON_BINARY" .venv ls pymongo # pip install -e ".[test]" - +ulimit -c unlimited python --version # pip install pytest pip install -v -e . From 89720197a56085ed6335a5f8313f416c9b54d5df Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 4 Jan 2025 09:15:42 -0600 Subject: [PATCH 18/25] try bson --- .evergreen/scripts/run-direct-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index 4cff866406..95c583a6d4 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -12,7 +12,7 @@ python --version # pip install pytest pip install -v -e . ls pymongo -python -c "import pymongo" +# python -c "import pymongo" python -c "import bson" # pytest --version From b223bef5bc1a96916e5a3e759e261741d2e12aeb Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 4 Jan 2025 17:22:35 -0600 Subject: [PATCH 19/25] more debug --- .evergreen/scripts/run-direct-tests.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index 95c583a6d4..dfa386d68d 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -2,6 +2,7 @@ set -x . .evergreen/utils.sh +env # . .evergreen/scripts/env.sh ls pymongo createvirtualenv "$PYTHON_BINARY" .venv @@ -10,6 +11,8 @@ ls pymongo ulimit -c unlimited python --version # pip install pytest +export PYMONGO_C_EXT_MUST_BUILD=1 +python _setup.py build_ext -i pip install -v -e . ls pymongo # python -c "import pymongo" From 291c369cc81bf58f1a886af6bb41f9099925cc83 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 4 Jan 2025 17:53:10 -0600 Subject: [PATCH 20/25] more debug --- .evergreen/scripts/run-direct-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index dfa386d68d..dbe3375115 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -12,6 +12,7 @@ ulimit -c unlimited python --version # pip install pytest export PYMONGO_C_EXT_MUST_BUILD=1 +pip install setuptools python _setup.py build_ext -i pip install -v -e . ls pymongo From 37961c8acca728981fdff3095bf06f1d8e3a5a01 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 6 Jan 2025 06:55:58 -0600 Subject: [PATCH 21/25] cleanup --- .evergreen/generated_configs/variants.yml | 8 -------- .evergreen/scripts/generate_config.py | 3 +++ .evergreen/setup-spawn-host.sh | 3 +-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index fcca7f96b9..b1db61d492 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -652,14 +652,6 @@ buildvariants: - macos-14-arm64 expansions: PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3t - - name: free-threaded-win64-python3.13t - tasks: - - name: .free-threading - display_name: Free-threaded Win64 Python3.13t - run_on: - - windows-64-vsMulti-small - expansions: - PYTHON_BINARY: C:/python/Python313/python3.13t.exe # Green framework tests - name: green-eventlet-rhel8-python3.9 diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index d0905cdb69..e8d0b171bd 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -325,6 +325,9 @@ def create_server_variants() -> list[BuildVariant]: def create_free_threaded_variants() -> list[BuildVariant]: variants = [] for host_name in ("rhel8", "macos", "macos-arm64", "win64"): + if host_name == "win64": + # TODO: PYTHON-5027 + continue tasks = [".free-threading"] host = HOSTS[host_name] python = "3.13t" diff --git a/.evergreen/setup-spawn-host.sh b/.evergreen/setup-spawn-host.sh index 4109e59183..1a526c762c 100755 --- a/.evergreen/setup-spawn-host.sh +++ b/.evergreen/setup-spawn-host.sh @@ -8,8 +8,7 @@ if [ -z "$1" ] fi target=$1 -user=${target%@*} -remote_dir=/home/$user/mongo-python-driver +remote_dir=/home/ec2-user/mongo-python-driver echo "Copying files to $target..." rsync -az -e ssh --exclude '.git' --filter=':- .gitignore' -r . $target:$remote_dir From 8c67ca5058b1c03d6cf5564208752f84621614b0 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 6 Jan 2025 07:19:15 -0600 Subject: [PATCH 22/25] cleanup --- .evergreen/scripts/run-direct-tests.sh | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.evergreen/scripts/run-direct-tests.sh b/.evergreen/scripts/run-direct-tests.sh index dbe3375115..a00235311c 100755 --- a/.evergreen/scripts/run-direct-tests.sh +++ b/.evergreen/scripts/run-direct-tests.sh @@ -2,22 +2,9 @@ set -x . .evergreen/utils.sh -env -# . .evergreen/scripts/env.sh -ls pymongo +. .evergreen/scripts/env.sh createvirtualenv "$PYTHON_BINARY" .venv -ls pymongo -# pip install -e ".[test]" -ulimit -c unlimited -python --version -# pip install pytest -export PYMONGO_C_EXT_MUST_BUILD=1 -pip install setuptools -python _setup.py build_ext -i -pip install -v -e . -ls pymongo -# python -c "import pymongo" -python -c "import bson" -# pytest --version +export PYMONGO_C_EXT_MUST_BUILD=1 +pip install -e ".[test]" pytest -v From 84e421810f57f41b5fd95a152d34e07225a80edf Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 6 Jan 2025 08:37:35 -0600 Subject: [PATCH 23/25] add changelog --- doc/changelog.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index d9e6cc3f5b..2f2b112467 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -13,8 +13,9 @@ PyMongo 4.11 brings a number of changes including: - Dropped support for Python 3.8. - Dropped support for MongoDB 3.6. - Dropped support for the MONGODB-CR authenticate mechanism, which is no longer supported by MongoDB 4.0+. -- Added support for free-threaded Python with the GIL disabled. For more information see: +- Added limited support for free-threaded Python with the GIL disabled. For more information see: `Free-threaded CPython `_. + We do not yet support free-threaded Python on Windows (`PYTHON-5027`_) or with Encryption (`PYTHON-5024`_). - :attr:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.address` and :attr:`~pymongo.mongo_client.MongoClient.address` now correctly block when called on unconnected clients until either connection succeeds or a server selection timeout error is raised. @@ -41,6 +42,8 @@ See the `PyMongo 4.11 release notes in JIRA`_ for the list of resolved issues in this release. .. _PyMongo 4.11 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=40784 +.. _PYTHON-5027: https://jira.mongodb.org/browse/PYTHON-5027 +.. _PYTHON-5024: https://jira.mongodb.org/browse/PYTHON-5024 Changes in Version 4.10.1 (2024/10/01) -------------------------------------- From db5a7bac9c9b2551be6936af6ea5696781484262 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 6 Jan 2025 08:38:44 -0600 Subject: [PATCH 24/25] undo changes --- .evergreen/config.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 97b09f7bc3..f854f6bd3d 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -116,30 +116,6 @@ functions: content_type: text/html display_name: "Coverage Report HTML" - "upload core dumps": - - command: ec2.assume_role - params: - role_arn: ${assume_role_arn} - - command: archive.targz_pack - params: - target: "mongo-coredumps.tgz" - source_dir: ${PROJECT_DIRECTORY}/ - include: - - "./**.core" - - "./**.mdmp" # Windows: minidumps - - command: s3.put - params: - aws_key: ${AWS_ACCESS_KEY_ID} - aws_secret: ${AWS_SECRET_ACCESS_KEY} - aws_session_token: ${AWS_SESSION_TOKEN} - local_file: mongo-coredumps.tgz - remote_file: ${build_variant}/${revision}/${version_id}/${build_id}/coredumps/${task_id}-${execution}-mongodb-coredumps.tar.gz - bucket: ${bucket_name} - permissions: public-read - content_type: ${content_type|application/gzip} - display_name: Core Dumps - Execution - optional: true - "upload mo artifacts": - command: ec2.assume_role params: @@ -668,7 +644,6 @@ post: - func: "teardown system" - func: "upload coverage" - func: "upload mo artifacts" - - func: "upload core dumps" - func: "upload test results" - func: "stop mongo-orchestration" - func: "cleanup" From 5a3bb74b3ab9fa6a4d8f676a2e23711ed20b9328 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 6 Jan 2025 16:33:09 -0600 Subject: [PATCH 25/25] address review --- doc/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index 2f2b112467..b2bee959a7 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -15,7 +15,7 @@ PyMongo 4.11 brings a number of changes including: - Dropped support for the MONGODB-CR authenticate mechanism, which is no longer supported by MongoDB 4.0+. - Added limited support for free-threaded Python with the GIL disabled. For more information see: `Free-threaded CPython `_. - We do not yet support free-threaded Python on Windows (`PYTHON-5027`_) or with Encryption (`PYTHON-5024`_). + We do not yet support free-threaded Python on Windows (`PYTHON-5027`_) or with In-Use Encryption (`PYTHON-5024`_). - :attr:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.address` and :attr:`~pymongo.mongo_client.MongoClient.address` now correctly block when called on unconnected clients until either connection succeeds or a server selection timeout error is raised.