Skip to content

Commit 1d46e75

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver into PYTHON-5566
2 parents ebe862d + 1e78bd4 commit 1d46e75

File tree

140 files changed

+2250
-723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+2250
-723
lines changed

.evergreen/generated_configs/tasks.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,98 @@ tasks:
199199
SUB_TEST_NAME: azure-fail
200200
tags: [pr]
201201

202+
# Min support tests
203+
- name: test-min-support-python3.9-standalone-noauth-nossl
204+
commands:
205+
- func: run server
206+
- func: run tests
207+
vars:
208+
UV_PYTHON: "3.9"
209+
AUTH: noauth
210+
SSL: nossl
211+
TOPOLOGY: standalone
212+
tags: [test-min-support]
213+
- name: test-min-support-python3.9-replica-set-noauth-ssl
214+
commands:
215+
- func: run server
216+
- func: run tests
217+
vars:
218+
UV_PYTHON: "3.9"
219+
AUTH: noauth
220+
SSL: ssl
221+
TOPOLOGY: replica_set
222+
tags: [test-min-support]
223+
- name: test-min-support-python3.9-sharded-cluster-auth-ssl
224+
commands:
225+
- func: run server
226+
- func: run tests
227+
vars:
228+
UV_PYTHON: "3.9"
229+
AUTH: auth
230+
SSL: ssl
231+
TOPOLOGY: sharded_cluster
232+
tags: [test-min-support]
233+
- name: test-min-support-pypy3.9-standalone-noauth-nossl
234+
commands:
235+
- func: run server
236+
- func: run tests
237+
vars:
238+
UV_PYTHON: pypy3.9
239+
AUTH: noauth
240+
SSL: nossl
241+
TOPOLOGY: standalone
242+
tags: [test-min-support]
243+
- name: test-min-support-pypy3.9-replica-set-noauth-ssl
244+
commands:
245+
- func: run server
246+
- func: run tests
247+
vars:
248+
UV_PYTHON: pypy3.9
249+
AUTH: noauth
250+
SSL: ssl
251+
TOPOLOGY: replica_set
252+
tags: [test-min-support]
253+
- name: test-min-support-pypy3.9-sharded-cluster-auth-ssl
254+
commands:
255+
- func: run server
256+
- func: run tests
257+
vars:
258+
UV_PYTHON: pypy3.9
259+
AUTH: auth
260+
SSL: ssl
261+
TOPOLOGY: sharded_cluster
262+
tags: [test-min-support]
263+
- name: test-min-support-pypy3.10-standalone-noauth-nossl
264+
commands:
265+
- func: run server
266+
- func: run tests
267+
vars:
268+
UV_PYTHON: pypy3.10
269+
AUTH: noauth
270+
SSL: nossl
271+
TOPOLOGY: standalone
272+
tags: [test-min-support]
273+
- name: test-min-support-pypy3.10-replica-set-noauth-ssl
274+
commands:
275+
- func: run server
276+
- func: run tests
277+
vars:
278+
UV_PYTHON: pypy3.10
279+
AUTH: noauth
280+
SSL: ssl
281+
TOPOLOGY: replica_set
282+
tags: [test-min-support]
283+
- name: test-min-support-pypy3.10-sharded-cluster-auth-ssl
284+
commands:
285+
- func: run server
286+
- func: run tests
287+
vars:
288+
UV_PYTHON: pypy3.10
289+
AUTH: auth
290+
SSL: ssl
291+
TOPOLOGY: sharded_cluster
292+
tags: [test-min-support]
293+
202294
# Mod wsgi tests
203295
- name: mod-wsgi-replica-set-python3.10
204296
commands:

.evergreen/generated_configs/variants.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,14 @@ buildvariants:
324324
expansions:
325325
TEST_NAME: load_balancer
326326

327+
# Min support tests
328+
- name: min-support-rhel8
329+
tasks:
330+
- name: .test-min-support
331+
display_name: Min Support RHEL8
332+
run_on:
333+
- rhel87-small
334+
327335
# Mockupdb tests
328336
- name: mockupdb-rhel8
329337
tasks:

.evergreen/scripts/generate_config.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,12 @@ def create_aws_auth_variants():
502502
return variants
503503

504504

505+
def create_min_support_variants():
506+
host = HOSTS["rhel8"]
507+
name = get_variant_name("Min Support", host=host)
508+
return [create_variant([".test-min-support"], name, host=host)]
509+
510+
505511
def create_no_server_variants():
506512
host = HOSTS["rhel8"]
507513
name = get_variant_name("No server", host=host)
@@ -891,6 +897,24 @@ def _create_ocsp_tasks(algo, variant, server_type, base_task_name):
891897
return tasks
892898

893899

900+
def create_min_support_tasks():
901+
server_func = FunctionCall(func="run server")
902+
from generate_config_utils import MIN_SUPPORT_VERSIONS
903+
904+
tasks = []
905+
for python, topology in product(MIN_SUPPORT_VERSIONS, TOPOLOGIES):
906+
auth, ssl = get_standard_auth_ssl(topology)
907+
vars = dict(UV_PYTHON=python, AUTH=auth, SSL=ssl, TOPOLOGY=topology)
908+
test_func = FunctionCall(func="run tests", vars=vars)
909+
task_name = get_task_name(
910+
"test-min-support", python=python, topology=topology, auth=auth, ssl=ssl
911+
)
912+
tags = ["test-min-support"]
913+
commands = [server_func, test_func]
914+
tasks.append(EvgTask(name=task_name, tags=tags, commands=commands))
915+
return tasks
916+
917+
894918
def create_aws_lambda_tasks():
895919
assume_func = FunctionCall(func="assume ec2 role")
896920
vars = dict(TEST_NAME="aws_lambda")

.evergreen/scripts/generate_config_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
ALL_VERSIONS = ["4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"]
2525
CPYTHONS = ["3.10", "3.11", "3.12", "3.13", "3.14t", "3.14"]
2626
PYPYS = ["pypy3.11"]
27+
MIN_SUPPORT_VERSIONS = ["3.9", "pypy3.9", "pypy3.10"]
2728
ALL_PYTHONS = CPYTHONS + PYPYS
2829
MIN_MAX_PYTHON = [CPYTHONS[0], CPYTHONS[-1]]
2930
BATCHTIME_WEEK = 10080

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4
49+
uses: github/codeql-action/init@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4
5050
with:
5151
languages: ${{ matrix.language }}
5252
build-mode: ${{ matrix.build-mode }}
@@ -63,6 +63,6 @@ jobs:
6363
pip install -e .
6464
6565
- name: Perform CodeQL Analysis
66-
uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4
66+
uses: github/codeql-action/analyze@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4
6767
with:
6868
category: "/language:${{matrix.language}}"

.github/workflows/dist.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
- name: Assert all versions in wheelhouse
8484
if: ${{ ! startsWith(matrix.buildplat[1], 'macos') }}
8585
run: |
86+
ls wheelhouse/*cp39*.whl
8687
ls wheelhouse/*cp310*.whl
8788
ls wheelhouse/*cp311*.whl
8889
ls wheelhouse/*cp312*.whl
@@ -91,7 +92,7 @@ jobs:
9192
# Free-threading builds:
9293
ls wheelhouse/*cp314t*.whl
9394
94-
- uses: actions/upload-artifact@v5
95+
- uses: actions/upload-artifact@v6
9596
with:
9697
name: wheel-${{ matrix.buildplat[1] }}
9798
path: ./wheelhouse/*.whl
@@ -110,7 +111,7 @@ jobs:
110111
- uses: actions/setup-python@v6
111112
with:
112113
# Build sdist on lowest supported Python
113-
python-version: "3.10"
114+
python-version: "3.9"
114115

115116
- name: Build SDist
116117
run: |
@@ -124,7 +125,7 @@ jobs:
124125
cd ..
125126
python -c "from pymongo import has_c; assert has_c()"
126127
127-
- uses: actions/upload-artifact@v5
128+
- uses: actions/upload-artifact@v6
128129
with:
129130
name: "sdist"
130131
path: ./dist/*.tar.gz
@@ -135,13 +136,13 @@ jobs:
135136
name: Download Wheels
136137
steps:
137138
- name: Download all workflow run artifacts
138-
uses: actions/download-artifact@v6
139+
uses: actions/download-artifact@v7
139140
- name: Flatten directory
140141
working-directory: .
141142
run: |
142143
find . -mindepth 2 -type f -exec mv {} . \;
143144
find . -type d -empty -delete
144-
- uses: actions/upload-artifact@v5
145+
- uses: actions/upload-artifact@v6
145146
with:
146147
name: all-dist-${{ github.run_id }}
147148
path: "./*"

.github/workflows/release-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
id-token: write
7676
steps:
7777
- name: Download all the dists
78-
uses: actions/download-artifact@v6
78+
uses: actions/download-artifact@v7
7979
with:
8080
name: all-dist-${{ github.run_id }}
8181
path: dist/

.github/workflows/sbom.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
branches: ['master']
1212
paths:
1313
- 'requirements.txt'
14+
- 'requirements/**.txt'
15+
- '!requirements/docs.txt'
16+
- '!requirements/test.txt'
1417

1518
permissions:
1619
contents: write
@@ -39,7 +42,8 @@ jobs:
3942
run: |
4043
python -m venv .venv
4144
source .venv/bin/activate
42-
pip install -r requirements.txt
45+
python tools/generate_sbom_requirements.py
46+
pip install -r sbom-requirements.txt
4347
pip install .
4448
pip uninstall -y pip setuptools
4549
deactivate
@@ -60,23 +64,23 @@ jobs:
6064

6165
- name: Cleanup
6266
if: always()
63-
run: rm -rf .venv .venv-sbom
67+
run: rm -rf .venv .venv-sbom sbom-requirements.txt
6468

6569
- name: Upload SBOM artifact
66-
uses: actions/upload-artifact@v5
70+
uses: actions/upload-artifact@v6
6771
with:
6872
name: sbom
6973
path: sbom.json
7074
if-no-files-found: error
7175

7276
- name: Create Pull Request
73-
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676
77+
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
7478
with:
7579
token: ${{ secrets.GITHUB_TOKEN }}
7680
commit-message: 'chore: Update SBOM after dependency changes'
7781
branch: auto-update-sbom-${{ github.run_id }}
7882
delete-branch: true
79-
title: 'chore: Update SBOM'
83+
title: 'Automation: Update SBOM'
8084
body: |
8185
## Automated SBOM Update
8286

.github/workflows/test-python.yml

Lines changed: 13 additions & 13 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@ed21f2f24f8dd64503750218de024bcf64c7250a # v7
29+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # 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@ed21f2f24f8dd64503750218de024bcf64c7250a # v7
71+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # 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@ed21f2f24f8dd64503750218de024bcf64c7250a # v7
90+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # 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@ed21f2f24f8dd64503750218de024bcf64c7250a # v7
115+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # 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@ed21f2f24f8dd64503750218de024bcf64c7250a # v7
134+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # 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@ed21f2f24f8dd64503750218de024bcf64c7250a # v7
156+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # 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@ed21f2f24f8dd64503750218de024bcf64c7250a # v7
177+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
178178
with:
179179
enable-cache: true
180180
python-version: "3.10"
@@ -208,13 +208,13 @@ jobs:
208208
cache: 'pip'
209209
cache-dependency-path: 'pyproject.toml'
210210
# Build sdist on lowest supported Python
211-
python-version: "3.10"
211+
python-version: "3.9"
212212
- name: Build SDist
213213
shell: bash
214214
run: |
215215
pip install build
216216
python -m build --sdist
217-
- uses: actions/upload-artifact@v5
217+
- uses: actions/upload-artifact@v6
218218
with:
219219
name: "sdist"
220220
path: dist/*.tar.gz
@@ -226,7 +226,7 @@ jobs:
226226
timeout-minutes: 20
227227
steps:
228228
- name: Download sdist
229-
uses: actions/download-artifact@v6
229+
uses: actions/download-artifact@v7
230230
with:
231231
path: sdist/
232232
- name: Unpack SDist
@@ -242,7 +242,7 @@ jobs:
242242
cache: 'pip'
243243
cache-dependency-path: 'sdist/test/pyproject.toml'
244244
# Test sdist on lowest supported Python
245-
python-version: "3.10"
245+
python-version: "3.9"
246246
- id: setup-mongodb
247247
uses: mongodb-labs/drivers-evergreen-tools@master
248248
- name: Run connect test from sdist
@@ -264,9 +264,9 @@ jobs:
264264
with:
265265
persist-credentials: false
266266
- name: Install uv
267-
uses: astral-sh/setup-uv@ed21f2f24f8dd64503750218de024bcf64c7250a # v7
267+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
268268
with:
269-
python-version: "3.10"
269+
python-version: "3.9"
270270
- id: setup-mongodb
271271
uses: mongodb-labs/drivers-evergreen-tools@master
272272
with:

.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@c0e2b1c877e25a91d1d747c438d49199cad29698
21+
uses: zizmorcore/zizmor-action@cb3d8e846e148d1111d90b03375b9c03deceda37

0 commit comments

Comments
 (0)