Skip to content

Commit 4e84bd4

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver
2 parents 071d09e + 2895e84 commit 4e84bd4

Some content is hidden

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

52 files changed

+363
-287
lines changed

.evergreen/config.yml

Lines changed: 74 additions & 141 deletions
Large diffs are not rendered by default.

.evergreen/utils.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ set -o xtrace
44

55
find_python3() {
66
PYTHON=""
7-
# Add a fallback system python3 if it is available and Python 3.8+.
8-
if is_python_38 "$(command -v python3)"; then
7+
# Add a fallback system python3 if it is available and Python 3.9+.
8+
if is_python_39 "$(command -v python3)"; then
99
PYTHON="$(command -v python3)"
1010
fi
1111
# Find a suitable toolchain version, if available.
@@ -14,23 +14,23 @@ find_python3() {
1414
if [ -d "/Library/Frameworks/Python.Framework/Versions/3.10" ]; then
1515
PYTHON="/Library/Frameworks/Python.Framework/Versions/3.10/bin/python3"
1616
# macos 10.14
17-
elif [ -d "/Library/Frameworks/Python.Framework/Versions/3.8" ]; then
18-
PYTHON="/Library/Frameworks/Python.Framework/Versions/3.8/bin/python3"
17+
elif [ -d "/Library/Frameworks/Python.Framework/Versions/3.9" ]; then
18+
PYTHON="/Library/Frameworks/Python.Framework/Versions/3.9/bin/python3"
1919
fi
2020
elif [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin
21-
PYTHON="C:/python/Python38/python.exe"
21+
PYTHON="C:/python/Python39/python.exe"
2222
else
23-
# Prefer our own toolchain, fall back to mongodb toolchain if it has Python 3.8+.
24-
if [ -f "/opt/python/3.8/bin/python3" ]; then
25-
PYTHON="/opt/python/3.8/bin/python3"
26-
elif is_python_38 "$(command -v /opt/mongodbtoolchain/v4/bin/python3)"; then
23+
# Prefer our own toolchain, fall back to mongodb toolchain if it has Python 3.9+.
24+
if [ -f "/opt/python/3.9/bin/python3" ]; then
25+
PYTHON="/opt/python/3.9/bin/python3"
26+
elif is_python_39 "$(command -v /opt/mongodbtoolchain/v4/bin/python3)"; then
2727
PYTHON="/opt/mongodbtoolchain/v4/bin/python3"
28-
elif is_python_38 "$(command -v /opt/mongodbtoolchain/v3/bin/python3)"; then
28+
elif is_python_39 "$(command -v /opt/mongodbtoolchain/v3/bin/python3)"; then
2929
PYTHON="/opt/mongodbtoolchain/v3/bin/python3"
3030
fi
3131
fi
3232
if [ -z "$PYTHON" ]; then
33-
echo "Cannot test without python3.8+ installed!"
33+
echo "Cannot test without python3.9+ installed!"
3434
exit 1
3535
fi
3636
echo "$PYTHON"
@@ -96,15 +96,15 @@ testinstall () {
9696
fi
9797
}
9898

99-
# Function that returns success if the provided Python binary is version 3.8 or later
99+
# Function that returns success if the provided Python binary is version 3.9 or later
100100
# Usage:
101-
# is_python_38 /path/to/python
101+
# is_python_39 /path/to/python
102102
# * param1: Python binary
103-
is_python_38() {
103+
is_python_39() {
104104
if [ -z "$1" ]; then
105105
return 1
106-
elif $1 -c "import sys; exit(sys.version_info[:2] < (3, 8))"; then
107-
# runs when sys.version_info[:2] >= (3, 8)
106+
elif $1 -c "import sys; exit(sys.version_info[:2] < (3, 9))"; then
107+
# runs when sys.version_info[:2] >= (3, 9)
108108
return 0
109109
else
110110
return 1

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
uses: actions/checkout@v4
4040
with:
4141
ref: ${{ inputs.ref }}
42-
- uses: actions/setup-python@v3
42+
- uses: actions/setup-python@v5
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL

.github/workflows/dist.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- uses: actions/setup-python@v5
5454
with:
5555
cache: 'pip'
56-
python-version: 3.8
56+
python-version: 3.9
5757
cache-dependency-path: 'pyproject.toml'
5858
allow-prereleases: true
5959

@@ -79,13 +79,12 @@ jobs:
7979
env:
8080
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
8181
CIBW_MANYLINUX_I686_IMAGE: manylinux1
82-
CIBW_BUILD: "cp38-${{ matrix.buildplat[1] }} cp39-${{ matrix.buildplat[1] }}"
82+
CIBW_BUILD: "cp39-${{ matrix.buildplat[1] }} cp39-${{ matrix.buildplat[1] }}"
8383
run: python -m cibuildwheel --output-dir wheelhouse
8484

8585
- name: Assert all versions in wheelhouse
8686
if: ${{ ! startsWith(matrix.buildplat[1], 'macos') }}
8787
run: |
88-
ls wheelhouse/*cp38*.whl
8988
ls wheelhouse/*cp39*.whl
9089
ls wheelhouse/*cp310*.whl
9190
ls wheelhouse/*cp311*.whl
@@ -109,7 +108,7 @@ jobs:
109108
- uses: actions/setup-python@v5
110109
with:
111110
# Build sdist on lowest supported Python
112-
python-version: '3.8'
111+
python-version: '3.9'
113112

114113
- name: Build SDist
115114
run: |

.github/workflows/test-python.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323
- uses: actions/setup-python@v5
2424
with:
25-
python-version: "3.8"
25+
python-version: "3.9"
2626
cache: 'pip'
2727
cache-dependency-path: 'pyproject.toml'
2828
- name: Install Python dependencies
@@ -51,7 +51,7 @@ jobs:
5151
strategy:
5252
matrix:
5353
os: [ubuntu-20.04]
54-
python-version: ["3.8", "pypy-3.9", "3.13"]
54+
python-version: ["3.9", "pypy-3.9", "3.13"]
5555
name: CPython ${{ matrix.python-version }}-${{ matrix.os }}
5656
steps:
5757
- uses: actions/checkout@v4
@@ -72,7 +72,7 @@ jobs:
7272
pip install hatch
7373
fi
7474
- name: Start MongoDB
75-
uses: supercharge/mongodb-github-action@1.10.0
75+
uses: supercharge/mongodb-github-action@1.11.0
7676
with:
7777
mongodb-version: 6.0
7878
- name: Run tests
@@ -87,14 +87,14 @@ jobs:
8787
- name: Setup Python
8888
uses: actions/setup-python@v5
8989
with:
90-
python-version: "3.8"
90+
python-version: "3.9"
9191
cache: 'pip'
9292
cache-dependency-path: 'pyproject.toml'
9393
- name: Install dependencies
9494
run: |
9595
pip install -U hatch pip
9696
- name: Start MongoDB
97-
uses: supercharge/mongodb-github-action@1.10.0
97+
uses: supercharge/mongodb-github-action@1.11.0
9898
with:
9999
mongodb-version: '8.0.0-rc4'
100100
- name: Run tests
@@ -111,7 +111,7 @@ jobs:
111111
cache: 'pip'
112112
cache-dependency-path: 'pyproject.toml'
113113
# Build docs on lowest supported Python for furo
114-
python-version: '3.8'
114+
python-version: '3.9'
115115
- name: Install dependencies
116116
run: |
117117
pip install -U pip hatch
@@ -129,7 +129,7 @@ jobs:
129129
cache: 'pip'
130130
cache-dependency-path: 'pyproject.toml'
131131
# Build docs on lowest supported Python for furo
132-
python-version: '3.8'
132+
python-version: '3.9'
133133
- name: Install dependencies
134134
run: |
135135
pip install -U pip hatch
@@ -142,7 +142,7 @@ jobs:
142142
runs-on: ubuntu-latest
143143
strategy:
144144
matrix:
145-
python: ["3.8", "3.11"]
145+
python: ["3.9", "3.11"]
146146
steps:
147147
- uses: actions/checkout@v4
148148
- uses: actions/setup-python@v5
@@ -167,7 +167,7 @@ jobs:
167167
cache: 'pip'
168168
cache-dependency-path: 'pyproject.toml'
169169
# Build sdist on lowest supported Python
170-
python-version: '3.8'
170+
python-version: '3.9'
171171
- name: Build SDist
172172
shell: bash
173173
run: |
@@ -199,9 +199,9 @@ jobs:
199199
cache: 'pip'
200200
cache-dependency-path: 'sdist/test/pyproject.toml'
201201
# Test sdist on lowest supported Python
202-
python-version: '3.8'
202+
python-version: '3.9'
203203
- name: Start MongoDB
204-
uses: supercharge/mongodb-github-action@1.10.0
204+
uses: supercharge/mongodb-github-action@1.11.0
205205
- name: Run connect test from sdist
206206
shell: bash
207207
run: |

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ be of interest or that has already been addressed.
1616

1717
## Supported Interpreters
1818

19-
PyMongo supports CPython 3.8+ and PyPy3.9+. Language features not
19+
PyMongo supports CPython 3.9+ and PyPy3.9+. Language features not
2020
supported by all interpreters can not be used.
2121

2222
## Style Guide

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ a native Python driver for MongoDB. The `gridfs` package is a
1414
[gridfs](https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst/)
1515
implementation on top of `pymongo`.
1616

17-
PyMongo supports MongoDB 3.6, 4.0, 4.2, 4.4, 5.0, 6.0, 7.0, and 8.0.
17+
PyMongo supports MongoDB 4.0, 4.2, 4.4, 5.0, 6.0, 7.0, and 8.0.
1818

1919
## Support / Feedback
2020

@@ -90,7 +90,7 @@ package that is incompatible with PyMongo.
9090

9191
## Dependencies
9292

93-
PyMongo supports CPython 3.8+ and PyPy3.9+.
93+
PyMongo supports CPython 3.9+ and PyPy3.9+.
9494

9595
Required dependencies:
9696

doc/changelog.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
Changelog
22
=========
33

4+
Changes in Version 4.11.0
5+
-------------------------
6+
7+
.. warning:: PyMongo 4.11 drops support for Python 3.8: Python 3.9+ or PyPy 3.9+ is now required.
8+
.. warning:: PyMongo 4.11 drops support for MongoDB 3.6. PyMongo now supports MongoDB 4.0+.
9+
Driver support for MongoDB 3.6 reached end of life in April 2024.
10+
11+
PyMongo 4.11 brings a number of changes including:
12+
13+
- Dropped support for Python 3.8.
14+
- Dropped support for MongoDB 3.6.
15+
16+
Issues Resolved
17+
...............
18+
19+
See the `PyMongo 4.11 release notes in JIRA`_ for the list of resolved issues
20+
in this release.
21+
22+
.. _PyMongo 4.11 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=40784
23+
424
Changes in Version 4.10.1
525
-------------------------
626

doc/common-issues.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Also see the :ref:`TLSErrors` section.
66
Server reports wire version X, PyMongo requires Y
77
-------------------------------------------------
88

9-
When one attempts to connect to a <=3.4 version server, PyMongo will throw the following error::
9+
When one attempts to connect to a <=3.6 version server, PyMongo will throw the following error::
1010

1111
>>> client.admin.command('ping')
1212
...
13-
pymongo.errors.ConfigurationError: Server at localhost:27017 reports wire version 5, but this version of PyMongo requires at least 6 (MongoDB 3.6).
13+
pymongo.errors.ConfigurationError: Server at localhost:27017 reports wire version 6, but this version of PyMongo requires at least 7 (MongoDB 4.0).
1414

1515
This is caused by the driver being too new for the server it is being run against.
16-
To resolve this issue either upgrade your database to version >= 3.6 or downgrade to PyMongo 3.x which supports MongoDB >= 2.6.
16+
To resolve this issue either upgrade your database to version >= 4.0 or downgrade to an early version of PyMongo which supports MongoDB < 4.0.
1717

1818

1919
'Cursor' object has no attribute '_Cursor__killed'

doc/examples/authentication.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,8 @@ the "MongoDB Challenge-Response" protocol::
9797
Default Authentication Mechanism
9898
--------------------------------
9999

100-
If no mechanism is specified, PyMongo automatically SCRAM-SHA-1 when connected
101-
to MongoDB 3.6 and negotiates the mechanism to use (SCRAM-SHA-1
102-
or SCRAM-SHA-256) when connected to MongoDB 4.0+.
100+
If no mechanism is specified, PyMongo automatically negotiates the mechanism to use (SCRAM-SHA-1
101+
or SCRAM-SHA-256) with the MongoDB server.
103102

104103
Default Database and "authSource"
105104
---------------------------------

0 commit comments

Comments
 (0)