Skip to content

Commit c6fcd83

Browse files
authored
PYTHON-3475 Add Python 3.11 Support to PyMongo 3 (#1084)
1 parent 53c4b98 commit c6fcd83

File tree

6 files changed

+20
-5
lines changed

6 files changed

+20
-5
lines changed

.evergreen/build-manylinux-internal.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mv dist/* validdist || true
1111

1212
# Compile wheels
1313
for PYTHON in /opt/python/*/bin/python; do
14-
if [[ ! $PYTHON =~ (cp27|cp35|cp36|cp37|cp38|cp39|cp310) ]]; then
14+
if [[ ! $PYTHON =~ (cp27|cp35|cp36|cp37|cp38|cp39|cp310|cp311) ]]; then
1515
continue
1616
fi
1717
# https://github.com/pypa/manylinux/issues/49

.evergreen/build-manylinux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ unexpected=$(find dist \! \( -iname dist -or \
4141
-iname '*cp37*' -or \
4242
-iname '*cp38*' -or \
4343
-iname '*cp39*' -or \
44-
-iname '*cp310*' \))
44+
-iname '*cp310*' -or \
45+
-iname '*cp311*' \))
4546
if [ -n "$unexpected" ]; then
4647
echo "Unexpected files:" $unexpected
4748
exit 1

.evergreen/build-windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rm -rf validdist
88
mkdir -p validdist
99
mv dist/* validdist || true
1010

11-
for VERSION in 27 35 36 37 38 39 310; do
11+
for VERSION in 27 35 36 37 38 39 310 311; do
1212
_pythons=(C:/Python/Python${VERSION}/python.exe \
1313
C:/Python/32/Python${VERSION}/python.exe)
1414
for PYTHON in "${_pythons[@]}"; do

.evergreen/config.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,6 +2120,10 @@ axes:
21202120
display_name: "Python 3.10"
21212121
variables:
21222122
PYTHON_BINARY: "/opt/python/3.10/bin/python3"
2123+
- id: "3.11"
2124+
display_name: "Python 3.11"
2125+
variables:
2126+
PYTHON_BINARY: "/opt/python/3.11/bin/python3"
21232127
- id: "pypy"
21242128
display_name: "PyPy"
21252129
variables:
@@ -2182,6 +2186,10 @@ axes:
21822186
display_name: "Python 3.10"
21832187
variables:
21842188
PYTHON_BINARY: "C:/python/Python310/python.exe"
2189+
- id: "3.11"
2190+
display_name: "Python 3.11"
2191+
variables:
2192+
PYTHON_BINARY: "C:/python/Python311/python.exe"
21852193

21862194
- id: python-version-windows-32
21872195
display_name: "Python"
@@ -2214,6 +2222,10 @@ axes:
22142222
display_name: "32-bit Python 3.10"
22152223
variables:
22162224
PYTHON_BINARY: "C:/python/32/Python310/python.exe"
2225+
- id: "3.11"
2226+
display_name: "32-bit Python 3.11"
2227+
variables:
2228+
PYTHON_BINARY: "C:/python/32/Python311/python.exe"
22172229

22182230
# Choice of mod_wsgi version
22192231
- id: mod-wsgi-version

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ def build_extension(self, ext):
420420
"Programming Language :: Python :: 3.8",
421421
"Programming Language :: Python :: 3.9",
422422
"Programming Language :: Python :: 3.10",
423+
"Programming Language :: Python :: 3.11",
423424
"Programming Language :: Python :: Implementation :: CPython",
424425
"Programming Language :: Python :: Implementation :: PyPy",
425426
"Topic :: Database",

test/test_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,8 +1647,9 @@ def server_description_count():
16471647
final_count = server_description_count()
16481648
# If a bug like PYTHON-2433 is reintroduced then too many
16491649
# ServerDescriptions will be kept alive and this test will fail:
1650-
# AssertionError: 4 != 22 within 5 delta (18 difference)
1651-
self.assertAlmostEqual(initial_count, final_count, delta=10)
1650+
# AssertionError: 19 != 46 within 15 delta (27 difference)
1651+
# On Python 3.11 we seem to get more of a delta.
1652+
self.assertAlmostEqual(initial_count, final_count, delta=20)
16521653

16531654
@unittest.skipIf(_HAVE_DNSPYTHON, "dnspython must not be installed")
16541655
def test_srv_no_dnspython_error(self):

0 commit comments

Comments
 (0)