Skip to content

Commit 9c70be4

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver into backpressure
2 parents 8dbf903 + e077ebd commit 9c70be4

32 files changed

+887
-634
lines changed

.evergreen/generated_configs/tasks.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ tasks:
102102
AWS_ROLE_SESSION_NAME: test
103103
TOOLCHAIN_VERSION: "3.14"
104104
tags: [auth-aws, auth-aws-web-identity]
105-
- name: test-auth-aws-latest-ecs-python3.10
105+
- name: test-auth-aws-latest-regular-python3.10-min-deps
106106
commands:
107107
- func: run server
108108
vars:
@@ -112,9 +112,21 @@ tasks:
112112
- func: run tests
113113
vars:
114114
TEST_NAME: auth_aws
115-
SUB_TEST_NAME: ecs
115+
SUB_TEST_NAME: regular
116116
TOOLCHAIN_VERSION: "3.10"
117-
tags: [auth-aws, auth-aws-ecs]
117+
TEST_MIN_DEPS: "1"
118+
tags: [auth-aws, auth-aws-regular]
119+
- name: test-auth-aws-ecs
120+
commands:
121+
- func: assume ec2 role
122+
- func: run server
123+
vars:
124+
VERSION: "8.0"
125+
- func: run tests
126+
vars:
127+
TEST_NAME: auth_aws
128+
SUB_TEST_NAME: ecs
129+
tags: [auth-aws-ecs]
118130

119131
# Backport pr tests
120132
- name: backport-pr

.evergreen/generated_configs/variants.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,27 +70,34 @@ buildvariants:
7070
tags: [pr]
7171

7272
# Aws auth tests
73-
- name: auth-aws-ubuntu-20
73+
- name: auth-aws-rhel8
7474
tasks:
7575
- name: .auth-aws
76-
display_name: Auth AWS Ubuntu-20
76+
display_name: Auth AWS RHEL8
7777
run_on:
78-
- ubuntu2004-small
78+
- rhel87-small
7979
tags: []
8080
- name: auth-aws-win64
8181
tasks:
82-
- name: .auth-aws !.auth-aws-ecs
82+
- name: .auth-aws
8383
display_name: Auth AWS Win64
8484
run_on:
85-
- windows-64-vsMulti-small
85+
- windows-2022-latest-small
8686
tags: []
8787
- name: auth-aws-macos
8888
tasks:
89-
- name: .auth-aws !.auth-aws-web-identity !.auth-aws-ecs !.auth-aws-ec2
89+
- name: .auth-aws !.auth-aws-web-identity !.auth-aws-ec2
9090
display_name: Auth AWS macOS
9191
run_on:
9292
- macos-14
9393
tags: [pr]
94+
- name: auth-aws-ecs-macos
95+
tasks:
96+
- name: .auth-aws-ecs
97+
display_name: Auth AWS ECS macOS
98+
run_on:
99+
- ubuntu2404-small
100+
tags: [pr]
94101

95102
# Aws lambda tests
96103
- name: faas-lambda
@@ -199,7 +206,7 @@ buildvariants:
199206
- name: .test-non-standard !.pypy
200207
display_name: Encryption Win64
201208
run_on:
202-
- windows-64-vsMulti-small
209+
- windows-2022-latest-small
203210
batchtime: 1440
204211
expansions:
205212
TEST_NAME: encryption
@@ -231,7 +238,7 @@ buildvariants:
231238
- name: .test-non-standard !.pypy
232239
display_name: Encryption crypt_shared Win64
233240
run_on:
234-
- windows-64-vsMulti-small
241+
- windows-2022-latest-small
235242
batchtime: 1440
236243
expansions:
237244
TEST_NAME: encryption
@@ -270,10 +277,10 @@ buildvariants:
270277
AUTH: auth
271278
- name: auth-enterprise-win64
272279
tasks:
273-
- name: .test-standard-auth !.pypy .auth
280+
- name: .test-standard-auth !.pypy .auth !.free-threaded
274281
display_name: Auth Enterprise Win64
275282
run_on:
276-
- windows-64-vsMulti-small
283+
- windows-2022-latest-small
277284
expansions:
278285
TEST_NAME: enterprise_auth
279286
AUTH: auth
@@ -384,7 +391,7 @@ buildvariants:
384391
- name: .ocsp-rsa !.ocsp-staple .4.4
385392
display_name: OCSP Win64
386393
run_on:
387-
- windows-64-vsMulti-small
394+
- windows-2022-latest-small
388395
batchtime: 10080
389396
- name: ocsp-macos
390397
tasks:
@@ -423,7 +430,7 @@ buildvariants:
423430
- name: "!.auth_oidc_remote .auth_oidc"
424431
display_name: Auth OIDC Win64
425432
run_on:
426-
- windows-64-vsMulti-small
433+
- windows-2022-latest-small
427434
batchtime: 1440
428435

429436
# Perf tests
@@ -462,7 +469,7 @@ buildvariants:
462469
- name: .test-standard !.pypy .async .replica_set-noauth-ssl
463470
display_name: PyOpenSSL Win64
464471
run_on:
465-
- rhel87-small
472+
- windows-2022-latest-small
466473
batchtime: 1440
467474
expansions:
468475
SUB_TEST_NAME: pyopenssl
@@ -606,7 +613,7 @@ buildvariants:
606613
- name: .test-standard !.pypy
607614
display_name: "* Test Win64"
608615
run_on:
609-
- windows-64-vsMulti-small
616+
- windows-2022-latest-small
610617
tags: [standard-non-linux]
611618
- name: test-win32
612619
tasks:
@@ -655,7 +662,7 @@ buildvariants:
655662
- name: .test-numpy
656663
display_name: Test Numpy Win64
657664
run_on:
658-
- windows-64-vsMulti-small
665+
- windows-2022-latest-small
659666
tags: [binary, vector]
660667
- name: test-numpy-win32
661668
tasks:

.evergreen/scripts/generate_config.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ def create_enterprise_auth_variants():
223223
if host == "macos":
224224
tasks = [".test-standard-auth !.pypy .auth !.free-threaded"]
225225
if host == "win64":
226-
tasks = [".test-standard-auth !.pypy .auth"]
226+
# https://jira.mongodb.org/browse/PYTHON-5704
227+
tasks = [".test-standard-auth !.pypy .auth !.free-threaded"]
227228
variant = create_variant(tasks, display_name, host=host, expansions=expansions)
228229
variants.append(variant)
229230
return variants
@@ -481,15 +482,15 @@ def create_perf_variants():
481482
def create_aws_auth_variants():
482483
variants = []
483484

484-
for host_name in ["ubuntu20", "win64", "macos"]:
485+
for host_name in ["rhel8", "win64", "macos"]:
485486
expansions = dict()
486487
tasks = [".auth-aws"]
487488
tags = []
488489
if host_name == "macos":
489-
tasks = [".auth-aws !.auth-aws-web-identity !.auth-aws-ecs !.auth-aws-ec2"]
490+
tasks = [".auth-aws !.auth-aws-web-identity !.auth-aws-ec2"]
490491
tags = ["pr"]
491492
elif host_name == "win64":
492-
tasks = [".auth-aws !.auth-aws-ecs"]
493+
tasks = [".auth-aws"]
493494
host = HOSTS[host_name]
494495
variant = create_variant(
495496
tasks,
@@ -499,6 +500,16 @@ def create_aws_auth_variants():
499500
expansions=expansions,
500501
)
501502
variants.append(variant)
503+
504+
# The ECS test must be run on Ubuntu 24 to match the Fargate Config.
505+
variant = create_variant(
506+
[".auth-aws-ecs"],
507+
get_variant_name("Auth AWS ECS", host),
508+
host=HOSTS["ubuntu24"],
509+
tags=tags,
510+
expansions=expansions,
511+
)
512+
variants.append(variant)
502513
return variants
503514

504515

@@ -788,19 +799,18 @@ def create_aws_tasks():
788799
"env-creds",
789800
"session-creds",
790801
"web-identity",
791-
"ecs",
792802
]
803+
assume_func = FunctionCall(func="assume ec2 role")
793804
for version, test_type, python in zip_cycle(get_versions_from("4.4"), aws_test_types, CPYTHONS):
794805
base_name = f"test-auth-aws-{version}"
795806
base_tags = ["auth-aws"]
796807
server_vars = dict(AUTH_AWS="1", VERSION=version)
797808
server_func = FunctionCall(func="run server", vars=server_vars)
798-
assume_func = FunctionCall(func="assume ec2 role")
799809
tags = [*base_tags, f"auth-aws-{test_type}"]
800810
if "t" in python:
801811
tags.append("free-threaded")
802812
test_vars = dict(TEST_NAME="auth_aws", SUB_TEST_NAME=test_type, TOOLCHAIN_VERSION=python)
803-
if python == ALL_PYTHONS[0] and test_type != "ecs":
813+
if python == ALL_PYTHONS[0]:
804814
test_vars["TEST_MIN_DEPS"] = "1"
805815
name = get_task_name(f"{base_name}-{test_type}", **test_vars)
806816
test_func = FunctionCall(func="run tests", vars=test_vars)
@@ -822,6 +832,16 @@ def create_aws_tasks():
822832
funcs = [server_func, assume_func, test_func]
823833
tasks.append(EvgTask(name=name, tags=tags, commands=funcs))
824834

835+
# Add the ECS task. This will run on Ubuntu 24 to match the
836+
# Fargate environment.
837+
tags = ["auth-aws-ecs"]
838+
test_vars = dict(TEST_NAME="auth_aws", SUB_TEST_NAME="ecs")
839+
name = get_task_name("test-auth-aws-ecs", **test_vars)
840+
test_func = FunctionCall(func="run tests", vars=test_vars)
841+
server_func = FunctionCall(func="run server", vars=dict(VERSION="8.0"))
842+
funcs = [assume_func, server_func, test_func]
843+
tasks.append(EvgTask(name=name, tags=tags, commands=funcs))
844+
825845
return tasks
826846

827847

.evergreen/scripts/generate_config_utils.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ class Host:
5959
# Hosts with toolchains.
6060
HOSTS["rhel8"] = Host("rhel8", "rhel87-small", "RHEL8", dict())
6161
HOSTS["win64"] = Host("win64", "windows-64-vsMulti-small", "Win64", dict())
62+
HOSTS["win-latest"] = Host("win-latest", "windows-2022-latest-small", "WinLatest", dict())
6263
HOSTS["win32"] = Host("win32", "windows-64-vsMulti-small", "Win32", dict())
6364
HOSTS["macos"] = Host("macos", "macos-14", "macOS", dict())
6465
HOSTS["macos-arm64"] = Host("macos-arm64", "macos-14-arm64", "macOS Arm64", dict())
65-
HOSTS["ubuntu20"] = Host("ubuntu20", "ubuntu2004-small", "Ubuntu-20", dict())
6666
HOSTS["ubuntu22"] = Host("ubuntu22", "ubuntu2204-small", "Ubuntu-22", dict())
67+
HOSTS["ubuntu24"] = Host("ubuntu24", "ubuntu2404-small", "Ubuntu-24", dict())
6768
HOSTS["perf"] = Host("perf", "rhel90-dbx-perf-large", "", dict())
6869
HOSTS["debian11"] = Host("debian11", "debian11-small", "Debian11", dict())
6970
DEFAULT_HOST = HOSTS["rhel8"]
@@ -139,6 +140,14 @@ def create_variant(
139140
expansions = expansions and expansions.copy() or dict()
140141
if version:
141142
expansions["VERSION"] = version
143+
# 8.0+ Windows builds must run on win-latest
144+
if (
145+
"win64" in display_name.lower()
146+
or "win32" in display_name.lower()
147+
and version
148+
and version >= "8.0"
149+
):
150+
kwargs["run_on"] = HOSTS["win-latest"].run_on
142151
return create_variant_generic(
143152
tasks, display_name, version=version, host=host, expansions=expansions, **kwargs
144153
)

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "weekly"
8+
cooldown:
9+
default-days: 7
810
groups:
911
actions:
1012
patterns:

.github/workflows/sbom.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
if-no-files-found: error
7575

7676
- name: Create Pull Request
77-
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
77+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
7878
with:
7979
token: ${{ secrets.GITHUB_TOKEN }}
8080
commit-message: 'chore: Update SBOM after dependency changes'

.github/workflows/test-python.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
persist-credentials: false
2828
- name: Install uv
29-
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
29+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
3030
with:
3131
enable-cache: true
3232
python-version: "3.10"
@@ -68,7 +68,7 @@ jobs:
6868
with:
6969
persist-credentials: false
7070
- name: Install uv
71-
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
71+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
7272
with:
7373
enable-cache: true
7474
python-version: ${{ matrix.python-version }}
@@ -87,7 +87,7 @@ jobs:
8787
with:
8888
persist-credentials: false
8989
- name: Install uv
90-
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
90+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
9191
with:
9292
enable-cache: true
9393
python-version: "3.10"
@@ -112,7 +112,7 @@ jobs:
112112
with:
113113
persist-credentials: false
114114
- name: Install uv
115-
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
115+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
116116
with:
117117
enable-cache: true
118118
python-version: "3.10"
@@ -131,7 +131,7 @@ jobs:
131131
with:
132132
persist-credentials: false
133133
- name: Install uv
134-
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
134+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
135135
with:
136136
enable-cache: true
137137
python-version: "3.10"
@@ -153,7 +153,7 @@ jobs:
153153
with:
154154
persist-credentials: false
155155
- name: Install uv
156-
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
156+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
157157
with:
158158
enable-cache: true
159159
python-version: "${{matrix.python}}"
@@ -174,7 +174,7 @@ jobs:
174174
with:
175175
persist-credentials: false
176176
- name: Install uv
177-
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
177+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
178178
with:
179179
enable-cache: true
180180
python-version: "3.10"
@@ -264,7 +264,7 @@ jobs:
264264
with:
265265
persist-credentials: false
266266
- name: Install uv
267-
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
267+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
268268
with:
269269
python-version: "3.9"
270270
- id: setup-mongodb

.github/workflows/zizmor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
with:
1919
persist-credentials: false
2020
- name: Run zizmor 🌈
21-
uses: zizmorcore/zizmor-action@706c51b5bce7adb027de71ab36d865f5d3fcc7b7
21+
uses: zizmorcore/zizmor-action@135698455da5c3b3e55f73f4419e481ab68cdd95 # v0.4.1

doc/api/pymongo/asynchronous/command_cursor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
.. automodule:: pymongo.asynchronous.command_cursor
66
:synopsis: Tools for iterating over MongoDB command results
77
:members:
8+
:inherited-members:

doc/api/pymongo/asynchronous/cursor.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
.. autoclass:: pymongo.asynchronous.cursor.AsyncCursor(collection, filter=None, projection=None, skip=0, limit=0, no_cursor_timeout=False, cursor_type=CursorType.NON_TAILABLE, sort=None, allow_partial_results=False, oplog_replay=False, batch_size=0, collation=None, hint=None, max_scan=None, max_time_ms=None, max=None, min=None, return_key=False, show_record_id=False, snapshot=False, comment=None, session=None, allow_disk_use=None)
99
:members:
10+
:inherited-members:
11+
1012

1113
.. describe:: c[index]
1214

0 commit comments

Comments
 (0)