Skip to content

Commit 510d49c

Browse files
authored
Merge branch 'master' into PYTHON-5513
2 parents e731089 + 60289f0 commit 510d49c

File tree

130 files changed

+2142
-535
lines changed

Some content is hidden

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

130 files changed

+2142
-535
lines changed

.evergreen/generated_configs/tasks.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,98 @@ tasks:
242242
TEST_MIN_DEPS: "1"
243243
tags: [test-min-deps, sharded_cluster-auth-ssl]
244244

245+
# Min support tests
246+
- name: test-min-support-python3.9-standalone-noauth-nossl
247+
commands:
248+
- func: run server
249+
- func: run tests
250+
vars:
251+
UV_PYTHON: "3.9"
252+
AUTH: noauth
253+
SSL: nossl
254+
TOPOLOGY: standalone
255+
tags: [test-min-support]
256+
- name: test-min-support-python3.9-replica-set-noauth-ssl
257+
commands:
258+
- func: run server
259+
- func: run tests
260+
vars:
261+
UV_PYTHON: "3.9"
262+
AUTH: noauth
263+
SSL: ssl
264+
TOPOLOGY: replica_set
265+
tags: [test-min-support]
266+
- name: test-min-support-python3.9-sharded-cluster-auth-ssl
267+
commands:
268+
- func: run server
269+
- func: run tests
270+
vars:
271+
UV_PYTHON: "3.9"
272+
AUTH: auth
273+
SSL: ssl
274+
TOPOLOGY: sharded_cluster
275+
tags: [test-min-support]
276+
- name: test-min-support-pypy3.9-standalone-noauth-nossl
277+
commands:
278+
- func: run server
279+
- func: run tests
280+
vars:
281+
UV_PYTHON: pypy3.9
282+
AUTH: noauth
283+
SSL: nossl
284+
TOPOLOGY: standalone
285+
tags: [test-min-support]
286+
- name: test-min-support-pypy3.9-replica-set-noauth-ssl
287+
commands:
288+
- func: run server
289+
- func: run tests
290+
vars:
291+
UV_PYTHON: pypy3.9
292+
AUTH: noauth
293+
SSL: ssl
294+
TOPOLOGY: replica_set
295+
tags: [test-min-support]
296+
- name: test-min-support-pypy3.9-sharded-cluster-auth-ssl
297+
commands:
298+
- func: run server
299+
- func: run tests
300+
vars:
301+
UV_PYTHON: pypy3.9
302+
AUTH: auth
303+
SSL: ssl
304+
TOPOLOGY: sharded_cluster
305+
tags: [test-min-support]
306+
- name: test-min-support-pypy3.10-standalone-noauth-nossl
307+
commands:
308+
- func: run server
309+
- func: run tests
310+
vars:
311+
UV_PYTHON: pypy3.10
312+
AUTH: noauth
313+
SSL: nossl
314+
TOPOLOGY: standalone
315+
tags: [test-min-support]
316+
- name: test-min-support-pypy3.10-replica-set-noauth-ssl
317+
commands:
318+
- func: run server
319+
- func: run tests
320+
vars:
321+
UV_PYTHON: pypy3.10
322+
AUTH: noauth
323+
SSL: ssl
324+
TOPOLOGY: replica_set
325+
tags: [test-min-support]
326+
- name: test-min-support-pypy3.10-sharded-cluster-auth-ssl
327+
commands:
328+
- func: run server
329+
- func: run tests
330+
vars:
331+
UV_PYTHON: pypy3.10
332+
AUTH: auth
333+
SSL: ssl
334+
TOPOLOGY: sharded_cluster
335+
tags: [test-min-support]
336+
245337
# Mod wsgi tests
246338
- name: mod-wsgi-replica-set-python3.10
247339
commands:

.evergreen/generated_configs/variants.yml

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

329+
# Min support tests
330+
- name: min-support-rhel8
331+
tasks:
332+
- name: .test-min-support
333+
display_name: Min Support RHEL8
334+
run_on:
335+
- rhel87-small
336+
329337
# Mockupdb tests
330338
- name: mockupdb-rhel8
331339
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)
@@ -897,6 +903,24 @@ def _create_ocsp_tasks(algo, variant, server_type, base_task_name):
897903
return tasks
898904

899905

906+
def create_min_support_tasks():
907+
server_func = FunctionCall(func="run server")
908+
from generate_config_utils import MIN_SUPPORT_VERSIONS
909+
910+
tasks = []
911+
for python, topology in product(MIN_SUPPORT_VERSIONS, TOPOLOGIES):
912+
auth, ssl = get_standard_auth_ssl(topology)
913+
vars = dict(UV_PYTHON=python, AUTH=auth, SSL=ssl, TOPOLOGY=topology)
914+
test_func = FunctionCall(func="run tests", vars=vars)
915+
task_name = get_task_name(
916+
"test-min-support", python=python, topology=topology, auth=auth, ssl=ssl
917+
)
918+
tags = ["test-min-support"]
919+
commands = [server_func, test_func]
920+
tasks.append(EvgTask(name=task_name, tags=tags, commands=commands))
921+
return tasks
922+
923+
900924
def create_aws_lambda_tasks():
901925
assume_func = FunctionCall(func="assume ec2 role")
902926
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)