Skip to content

Commit 69f9447

Browse files
authored
Merge branch 'master' into PYTHON-1752
2 parents 9485e42 + 02c3df6 commit 69f9447

39 files changed

+521
-186
lines changed

.evergreen/generated_configs/variants.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,17 +620,19 @@ buildvariants:
620620
- macos-14
621621
batchtime: 10080
622622
expansions:
623+
TEST_NAME: default
623624
SUB_TEST_NAME: pyopenssl
624625
PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3
625626
- name: pyopenssl-rhel8-python3.10
626627
tasks:
627-
- name: .replica_set .auth .ssl .sync
628-
- name: .7.0 .auth .ssl .sync
628+
- name: .replica_set .auth .ssl .sync_async
629+
- name: .7.0 .auth .ssl .sync_async
629630
display_name: PyOpenSSL RHEL8 Python3.10
630631
run_on:
631632
- rhel87-small
632633
batchtime: 10080
633634
expansions:
635+
TEST_NAME: default
634636
SUB_TEST_NAME: pyopenssl
635637
PYTHON_BINARY: /opt/python/3.10/bin/python3
636638
- name: pyopenssl-rhel8-python3.11
@@ -642,6 +644,7 @@ buildvariants:
642644
- rhel87-small
643645
batchtime: 10080
644646
expansions:
647+
TEST_NAME: default
645648
SUB_TEST_NAME: pyopenssl
646649
PYTHON_BINARY: /opt/python/3.11/bin/python3
647650
- name: pyopenssl-rhel8-python3.12
@@ -653,17 +656,19 @@ buildvariants:
653656
- rhel87-small
654657
batchtime: 10080
655658
expansions:
659+
TEST_NAME: default
656660
SUB_TEST_NAME: pyopenssl
657661
PYTHON_BINARY: /opt/python/3.12/bin/python3
658662
- name: pyopenssl-win64-python3.13
659663
tasks:
660-
- name: .replica_set .auth .ssl .sync
661-
- name: .7.0 .auth .ssl .sync
664+
- name: .replica_set .auth .ssl .sync_async
665+
- name: .7.0 .auth .ssl .sync_async
662666
display_name: PyOpenSSL Win64 Python3.13
663667
run_on:
664668
- windows-64-vsMulti-small
665669
batchtime: 10080
666670
expansions:
671+
TEST_NAME: default
667672
SUB_TEST_NAME: pyopenssl
668673
PYTHON_BINARY: C:/python/Python313/python.exe
669674
- name: pyopenssl-rhel8-pypy3.10
@@ -675,6 +680,7 @@ buildvariants:
675680
- rhel87-small
676681
batchtime: 10080
677682
expansions:
683+
TEST_NAME: default
678684
SUB_TEST_NAME: pyopenssl
679685
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
680686

.evergreen/scripts/configure-env.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ EOT
9696
_bin_path=""
9797
if [ "Windows_NT" == "${OS:-}" ]; then
9898
_bin_path="/cygdrive/c/Python/Current/Scripts"
99-
elif [ "$(uname -s)" != "Darwin" ]; then
99+
elif [ "$(uname -s)" == "Darwin" ]; then
100100
_bin_path="/Library/Frameworks/Python.Framework/Versions/Current/bin"
101101
else
102102
_bin_path="/opt/python/Current/bin"
@@ -106,6 +106,7 @@ if [ -d "${_bin_path}" ]; then
106106
if [ "Windows_NT" == "${OS:-}" ]; then
107107
_suffix=".exe"
108108
fi
109+
echo "Symlinking binaries from toolchain"
109110
mkdir -p $PYMONGO_BIN_DIR
110111
ln -s ${_bin_path}/just${_suffix} $PYMONGO_BIN_DIR/just${_suffix}
111112
ln -s ${_bin_path}/uv${_suffix} $PYMONGO_BIN_DIR/uv${_suffix}

.evergreen/scripts/generate_config.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def create_enterprise_auth_variants():
250250
def create_pyopenssl_variants():
251251
base_name = "PyOpenSSL"
252252
batchtime = BATCHTIME_WEEK
253-
expansions = dict(SUB_TEST_NAME="pyopenssl")
253+
expansions = dict(TEST_NAME="default", SUB_TEST_NAME="pyopenssl")
254254
variants = []
255255

256256
for python in ALL_PYTHONS:
@@ -265,14 +265,25 @@ def create_pyopenssl_variants():
265265
host = DEFAULT_HOST
266266

267267
display_name = get_variant_name(base_name, host, python=python)
268-
variant = create_variant(
269-
[f".replica_set .{auth} .{ssl} .sync", f".7.0 .{auth} .{ssl} .sync"],
270-
display_name,
271-
python=python,
272-
host=host,
273-
expansions=expansions,
274-
batchtime=batchtime,
275-
)
268+
# only need to run some on async
269+
if python in (CPYTHONS[1], CPYTHONS[-1]):
270+
variant = create_variant(
271+
[f".replica_set .{auth} .{ssl} .sync_async", f".7.0 .{auth} .{ssl} .sync_async"],
272+
display_name,
273+
python=python,
274+
host=host,
275+
expansions=expansions,
276+
batchtime=batchtime,
277+
)
278+
else:
279+
variant = create_variant(
280+
[f".replica_set .{auth} .{ssl} .sync", f".7.0 .{auth} .{ssl} .sync"],
281+
display_name,
282+
python=python,
283+
host=host,
284+
expansions=expansions,
285+
batchtime=batchtime,
286+
)
276287
variants.append(variant)
277288

278289
return variants

.evergreen/scripts/install-dependencies.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ if [ -f $HERE/env.sh ]; then
1010
. $HERE/env.sh
1111
fi
1212

13-
_BIN_DIR=${PYMONGO_BIN_DIR:-$HOME/.local/bin}
14-
export PATH="$PATH:${_BIN_DIR}"
15-
1613
# Helper function to pip install a dependency using a temporary python env.
1714
function _pip_install() {
1815
_HERE=$(dirname ${BASH_SOURCE:-$0})
@@ -28,23 +25,27 @@ function _pip_install() {
2825
if [ "Windows_NT" = "${OS:-}" ]; then
2926
_suffix=".exe"
3027
fi
31-
ln -s "$(which $2)" $_BIN_DIR/${2}${_suffix}
28+
ln -s "$(which $2)" $PYMONGO_BIN_DIR/${2}${_suffix}
3229
# uv also comes with a uvx binary.
3330
if [ $2 == "uv" ]; then
34-
ln -s "$(which uvx)" $_BIN_DIR/uvx${_suffix}
31+
ln -s "$(which uvx)" $PYMONGO_BIN_DIR/uvx${_suffix}
3532
fi
36-
echo "Installed to ${_BIN_DIR}"
33+
echo "Installed to ${PYMONGO_BIN_DIR}"
3734
echo "Installing $2 using pip... done."
3835
}
3936

40-
4137
# Ensure just is installed.
42-
if ! command -v just >/dev/null 2>&1; then
38+
if ! command -v just &>/dev/null; then
4339
# On most systems we can install directly.
4440
_TARGET=""
4541
if [ "Windows_NT" = "${OS:-}" ]; then
4642
_TARGET="--target x86_64-pc-windows-msvc"
4743
fi
44+
if [ -z "${PYMONGO_BIN_DIR:-}" ]; then
45+
echo "Please install just!"
46+
exit 1
47+
fi
48+
_BIN_DIR=$PYMONGO_BIN_DIR
4849
echo "Installing just..."
4950
mkdir -p "$_BIN_DIR" 2>/dev/null || true
5051
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $_TARGET --to "$_BIN_DIR" || {
@@ -53,8 +54,13 @@ if ! command -v just >/dev/null 2>&1; then
5354
echo "Installing just... done."
5455
fi
5556

56-
# Install uv.
57-
if ! command -v uv >/dev/null 2>&1; then
57+
# Ensure uv is installed.
58+
if ! command -v uv &>/dev/null; then
59+
if [ -z "${PYMONGO_BIN_DIR:-}" ]; then
60+
echo "Please install uv!"
61+
exit 1
62+
fi
63+
_BIN_DIR=$PYMONGO_BIN_DIR
5864
echo "Installing uv..."
5965
# On most systems we can install directly.
6066
curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="$_BIN_DIR" INSTALLER_NO_MODIFY_PATH=1 sh || {

.github/workflows/codeql.yml

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

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@v3
49+
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3
5050
with:
5151
languages: ${{ matrix.language }}
5252
build-mode: ${{ matrix.build-mode }}
5353
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5454
queries: security-extended
5555
config: |
5656
paths-ignore:
57-
- '.github/**'
5857
- 'doc/**'
5958
- 'tools/**'
6059
- 'test/**'
@@ -64,6 +63,6 @@ jobs:
6463
pip install -e .
6564
6665
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v3
66+
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3
6867
with:
6968
category: "/language:${{matrix.language}}"

.github/workflows/dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
- name: Set up QEMU
6262
if: runner.os == 'Linux'
63-
uses: docker/setup-qemu-action@v3
63+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
6464
with:
6565
# setup-qemu-action by default uses `tonistiigi/binfmt:latest` image,
6666
# which is out of date. This causes seg faults during build.

.github/workflows/release-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ jobs:
8181
name: all-dist-${{ github.run_id }}
8282
path: dist/
8383
- name: Publish package distributions to TestPyPI
84-
uses: pypa/gh-action-pypi-publish@release/v1
84+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1
8585
with:
8686
repository-url: https://test.pypi.org/legacy/
8787
skip-existing: true
8888
attestations: ${{ env.DRY_RUN }}
8989
- name: Publish package distributions to PyPI
9090
if: startsWith(env.DRY_RUN, 'false')
91-
uses: pypa/gh-action-pypi-publish@release/v1
91+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1
9292

9393
post-publish:
9494
needs: [publish]

.github/workflows/test-python.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
with:
2424
persist-credentials: false
2525
- name: Install just
26-
uses: extractions/setup-just@v3
26+
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
2727
- name: Install uv
28-
uses: astral-sh/setup-uv@v5
28+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
2929
with:
3030
enable-cache: true
3131
python-version: "3.9"
@@ -63,16 +63,16 @@ jobs:
6363
with:
6464
persist-credentials: false
6565
- name: Install just
66-
uses: extractions/setup-just@v3
66+
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
6767
- name: Install uv
68-
uses: astral-sh/setup-uv@v5
68+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
6969
with:
7070
enable-cache: true
7171
python-version: ${{ matrix.python-version }}
7272
- name: Install dependencies
7373
run: just install
7474
- name: Start MongoDB
75-
uses: supercharge/[email protected]
75+
uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # 1.12.0
7676
with:
7777
mongodb-version: 6.0
7878
- name: Run tests
@@ -86,14 +86,14 @@ jobs:
8686
with:
8787
persist-credentials: false
8888
- name: Install just
89-
uses: extractions/setup-just@v3
89+
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
9090
- name: Install uv
91-
uses: astral-sh/setup-uv@v5
91+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
9292
with:
9393
enable-cache: true
9494
python-version: "3.9"
9595
- name: Start MongoDB
96-
uses: supercharge/[email protected]
96+
uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # 1.12.0
9797
with:
9898
mongodb-version: '8.0.0-rc4'
9999
- name: Install dependencies
@@ -111,12 +111,12 @@ jobs:
111111
with:
112112
persist-credentials: false
113113
- name: Install uv
114-
uses: astral-sh/setup-uv@v5
114+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
115115
with:
116116
enable-cache: true
117117
python-version: "3.9"
118118
- name: Install just
119-
uses: extractions/setup-just@v3
119+
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
120120
- name: Install dependencies
121121
run: just install
122122
- name: Build docs
@@ -130,12 +130,12 @@ jobs:
130130
with:
131131
persist-credentials: false
132132
- name: Install uv
133-
uses: astral-sh/setup-uv@v5
133+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
134134
with:
135135
enable-cache: true
136136
python-version: "3.9"
137137
- name: Install just
138-
uses: extractions/setup-just@v3
138+
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
139139
- name: Install dependencies
140140
run: just install
141141
- name: Build docs
@@ -152,12 +152,12 @@ jobs:
152152
with:
153153
persist-credentials: false
154154
- name: Install uv
155-
uses: astral-sh/setup-uv@v5
155+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
156156
with:
157157
enable-cache: true
158158
python-version: "${{matrix.python}}"
159159
- name: Install just
160-
uses: extractions/setup-just@v3
160+
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
161161
- name: Install dependencies
162162
run: |
163163
just install
@@ -211,7 +211,7 @@ jobs:
211211
# Test sdist on lowest supported Python
212212
python-version: '3.9'
213213
- name: Start MongoDB
214-
uses: supercharge/[email protected]
214+
uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # 1.12.0
215215
- name: Run connect test from sdist
216216
shell: bash
217217
run: |

.github/workflows/zizmor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
with:
1919
persist-credentials: false
2020
- name: Setup Rust
21-
uses: actions-rust-lang/setup-rust-toolchain@v1
21+
uses: actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 # v1
2222
- name: Get zizmor
2323
run: cargo install zizmor
2424
- name: Run zizmor 🌈
2525
run: zizmor --format sarif . > results.sarif
2626
env:
2727
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828
- name: Upload SARIF file
29-
uses: github/codeql-action/upload-sarif@v3
29+
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3
3030
with:
3131
sarif_file: results.sarif
3232
category: zizmor

doc/api/bson/binary.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
.. autodata:: MD5_SUBTYPE
1717
.. autodata:: COLUMN_SUBTYPE
1818
.. autodata:: SENSITIVE_SUBTYPE
19+
.. autodata:: VECTOR_SUBTYPE
1920
.. autodata:: USER_DEFINED_SUBTYPE
2021

2122
.. autoclass:: UuidRepresentation

doc/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Version 4.12.1 is a bug fix release.
1616
errors such as: "NotImplementedError: Database objects do not implement truth value testing or bool()".
1717
- Removed Eventlet testing against Python versions newer than 3.9 since
1818
Eventlet is actively being sunset by its maintainers and has compatibility issues with PyMongo's dnspython dependency.
19+
- Fixed a bug where MongoDB cluster topology changes could cause asynchronous operations to take much longer to complete
20+
due to holding the Topology lock while closing stale connections.
21+
- Fixed a bug that would cause AsyncMongoClient to attempt to use PyOpenSSL when available, resulting in errors such as
22+
"pymongo.errors.ServerSelectionTimeoutError: 'SSLContext' object has no attribute 'wrap_bio'".
1923

2024
Issues Resolved
2125
...............

0 commit comments

Comments
 (0)