Skip to content

Commit e9744f2

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver
2 parents 0634cef + 85c5ee4 commit e9744f2

File tree

12 files changed

+46
-36
lines changed

12 files changed

+46
-36
lines changed

.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/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 & 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@v3
49+
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3
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@v3
66+
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3
6767
with:
6868
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/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Changelog
22
=========
33

44

5-
Changes in Version 4.12.1 (XXXX/XX/XX)
5+
Changes in Version 4.12.1 (2025/04/29)
66
--------------------------------------
77

88
Version 4.12.1 is a bug fix release.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
55
[project]
66
name = "pymongo"
77
dynamic = ["version", "dependencies", "optional-dependencies"]
8-
description = "Python driver for MongoDB <http://www.mongodb.org>"
8+
description = "PyMongo - the Official MongoDB Python driver"
99
readme = "README.md"
1010
license = {file="LICENSE"}
1111
requires-python = ">=3.9"

test/asynchronous/test_srv_polling.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import time
2121
from test.utils_shared import FunctionCallRecorder
2222
from typing import Any
23+
from unittest import skipIf
2324

2425
sys.path[0:0] = [""]
2526

@@ -91,6 +92,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
9192
self.disable()
9293

9394

95+
@skipIf(not _IS_SYNC and sys.platform == "win32", "PYTHON-5342 known issue on Windows")
9496
class TestSrvPolling(AsyncPyMongoTestCase):
9597
BASE_SRV_RESPONSE = [
9698
("localhost.test.build.10gen.cc", 27017),

test/test_srv_polling.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import time
2121
from test.utils_shared import FunctionCallRecorder
2222
from typing import Any
23+
from unittest import skipIf
2324

2425
sys.path[0:0] = [""]
2526

@@ -91,6 +92,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
9192
self.disable()
9293

9394

95+
@skipIf(not _IS_SYNC and sys.platform == "win32", "PYTHON-5342 known issue on Windows")
9496
class TestSrvPolling(PyMongoTestCase):
9597
BASE_SRV_RESPONSE = [
9698
("localhost.test.build.10gen.cc", 27017),

uv.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)