Skip to content

Commit bd8f73d

Browse files
authored
Merge branch 'master' into PYTHON-5401
2 parents 3a02f26 + ee851ba commit bd8f73d

File tree

12 files changed

+2080
-53
lines changed

12 files changed

+2080
-53
lines changed

.evergreen/spec-patch/PYTHON-5668.patch

Lines changed: 1578 additions & 0 deletions
Large diffs are not rendered by default.

.evergreen/spec-patch/PYTHON-5759.patch

Lines changed: 460 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/dist.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161

6262
- name: Set up QEMU
6363
if: runner.os == 'Linux'
64-
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
64+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
6565
with:
6666
# setup-qemu-action by default uses `tonistiigi/binfmt:latest` image,
6767
# which is out of date. This causes seg faults during build.
@@ -92,7 +92,7 @@ jobs:
9292
# Free-threading builds:
9393
ls wheelhouse/*cp314t*.whl
9494
95-
- uses: actions/upload-artifact@v6
95+
- uses: actions/upload-artifact@v7
9696
with:
9797
name: wheel-${{ matrix.buildplat[1] }}
9898
path: ./wheelhouse/*.whl
@@ -125,7 +125,7 @@ jobs:
125125
cd ..
126126
python -c "from pymongo import has_c; assert has_c()"
127127
128-
- uses: actions/upload-artifact@v6
128+
- uses: actions/upload-artifact@v7
129129
with:
130130
name: "sdist"
131131
path: ./dist/*.tar.gz
@@ -136,13 +136,13 @@ jobs:
136136
name: Download Wheels
137137
steps:
138138
- name: Download all workflow run artifacts
139-
uses: actions/download-artifact@v7
139+
uses: actions/download-artifact@v8
140140
- name: Flatten directory
141141
working-directory: .
142142
run: |
143143
find . -mindepth 2 -type f -exec mv {} . \;
144144
find . -type d -empty -delete
145-
- uses: actions/upload-artifact@v6
145+
- uses: actions/upload-artifact@v7
146146
with:
147147
name: all-dist-${{ github.run_id }}
148148
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@v7
78+
uses: actions/download-artifact@v8
7979
with:
8080
name: all-dist-${{ github.run_id }}
8181
path: dist/

.github/workflows/sbom.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
run: rm -rf .venv .venv-sbom sbom-requirements.txt
6868

6969
- name: Upload SBOM artifact
70-
uses: actions/upload-artifact@v6
70+
uses: actions/upload-artifact@v7
7171
with:
7272
name: sbom
7373
path: sbom.json

.github/workflows/test-python.yml

Lines changed: 11 additions & 11 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@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
29+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # 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@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
71+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
7272
with:
7373
enable-cache: true
7474
python-version: ${{ matrix.python-version }}
@@ -90,7 +90,7 @@ jobs:
9090
with:
9191
persist-credentials: false
9292
- name: Install uv
93-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
93+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
9494
with:
9595
enable-cache: true
9696
python-version: "3.10"
@@ -118,7 +118,7 @@ jobs:
118118
with:
119119
persist-credentials: false
120120
- name: Install uv
121-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
121+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
122122
with:
123123
enable-cache: true
124124
python-version: "3.10"
@@ -143,7 +143,7 @@ jobs:
143143
with:
144144
persist-credentials: false
145145
- name: Install uv
146-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
146+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
147147
with:
148148
enable-cache: true
149149
python-version: "3.10"
@@ -162,7 +162,7 @@ jobs:
162162
with:
163163
persist-credentials: false
164164
- name: Install uv
165-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
165+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
166166
with:
167167
enable-cache: true
168168
python-version: "3.10"
@@ -184,7 +184,7 @@ jobs:
184184
with:
185185
persist-credentials: false
186186
- name: Install uv
187-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
187+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
188188
with:
189189
enable-cache: true
190190
python-version: "${{matrix.python}}"
@@ -205,7 +205,7 @@ jobs:
205205
with:
206206
persist-credentials: false
207207
- name: Install uv
208-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
208+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
209209
with:
210210
enable-cache: true
211211
python-version: "3.10"
@@ -245,7 +245,7 @@ jobs:
245245
run: |
246246
pip install build
247247
python -m build --sdist
248-
- uses: actions/upload-artifact@v6
248+
- uses: actions/upload-artifact@v7
249249
with:
250250
name: "sdist"
251251
path: dist/*.tar.gz
@@ -257,7 +257,7 @@ jobs:
257257
timeout-minutes: 20
258258
steps:
259259
- name: Download sdist
260-
uses: actions/download-artifact@v7
260+
uses: actions/download-artifact@v8
261261
with:
262262
path: sdist/
263263
- name: Unpack SDist
@@ -295,7 +295,7 @@ jobs:
295295
with:
296296
persist-credentials: false
297297
- name: Install uv
298-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
298+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
299299
with:
300300
python-version: "3.9"
301301
- 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@0dce2577a4760a2749d8cfb7a84b7d5585ebcb7d # v0.5.0
21+
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Python Versions](https://img.shields.io/pypi/pyversions/pymongo)](https://pypi.org/project/pymongo)
55
[![Monthly Downloads](https://static.pepy.tech/badge/pymongo/month)](https://pepy.tech/project/pymongo)
66
[![API Documentation Status](https://readthedocs.org/projects/pymongo/badge/?version=stable)](http://pymongo.readthedocs.io/en/stable/api?badge=stable)
7+
[![codecov](https://codecov.io/gh/mongodb/mongo-python-driver/graph/badge.svg?branch=master)](https://codecov.io/gh/mongodb/mongo-python-driver)
78

89
## About
910

bson/son.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import copy
2424
import re
25+
import warnings
2526
from collections.abc import Mapping as _Mapping
2627
from typing import (
2728
Any,
@@ -99,13 +100,28 @@ def __iter__(self) -> Iterator[_Key]:
99100
yield from self.__keys
100101

101102
def has_key(self, key: _Key) -> bool:
103+
warnings.warn(
104+
"SON.has_key() is deprecated, use the in operator instead",
105+
DeprecationWarning,
106+
stacklevel=2,
107+
)
102108
return key in self.__keys
103109

104110
def iterkeys(self) -> Iterator[_Key]:
111+
warnings.warn(
112+
"SON.iterkeys() is deprecated, use the keys() method instead",
113+
DeprecationWarning,
114+
stacklevel=2,
115+
)
105116
return self.__iter__()
106117

107118
# fourth level uses definitions from lower levels
108119
def itervalues(self) -> Iterator[_Value]:
120+
warnings.warn(
121+
"SON.itervalues() is deprecated, use the values() method instead",
122+
DeprecationWarning,
123+
stacklevel=2,
124+
)
109125
for _, v in self.items():
110126
yield v
111127

doc/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Changes in Version 4.17.0 (2026/XX/XX)
66

77
PyMongo 4.17 brings a number of changes including:
88

9+
- ``has_key``, ``iterkeys`` and ``itervalues`` in :class:`bson.son.SON` have
10+
been deprecated and will be removed in PyMongo 5.0. These methods were
11+
deprecated in favor of the standard dictionary containment operator ``in``
12+
and the ``keys()`` and ``values()`` methods, respectively.
13+
914
- Added the :meth:`~pymongo.asynchronous.client_session.AsyncClientSession.bind` and :meth:`~pymongo.client_session.ClientSession.bind` methods
1015
that allow users to bind a session to all database operations within the scope of a context manager instead of having to explicitly pass the session to each individual operation.
1116
See <PLACEHOLDER> for examples and more information.

0 commit comments

Comments
 (0)