Skip to content

Commit df77653

Browse files
authored
PYTHON-3347 Test against Python 3.11 prerelease (#1069)
1 parent 4e11bda commit df77653

File tree

9 files changed

+22
-6
lines changed

9 files changed

+22
-6
lines changed

.evergreen/build-mac.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ mkdir -p validdist
99
mv dist/* validdist || true
1010

1111
VERSION=${VERSION:-3.10}
12+
1213
PYTHON=/Library/Frameworks/Python.framework/Versions/$VERSION/bin/python3
1314
rm -rf build
1415

.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 =~ (cp37|cp38|cp39|cp310) ]]; then
14+
if [[ ! $PYTHON =~ (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
@@ -37,7 +37,8 @@ unexpected=$(find dist \! \( -iname dist -or \
3737
-iname '*cp37*' -or \
3838
-iname '*cp38*' -or \
3939
-iname '*cp39*' -or \
40-
-iname '*cp310*' \))
40+
-iname '*cp310*' -or \
41+
-iname '*cp311*' \))
4142
if [ -n "$unexpected" ]; then
4243
echo "Unexpected files:" $unexpected
4344
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 37 38 39 310; do
11+
for VERSION in 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
@@ -2080,6 +2080,10 @@ axes:
20802080
display_name: "Python 3.10"
20812081
variables:
20822082
PYTHON_BINARY: "/opt/python/3.10/bin/python3"
2083+
- id: "3.11"
2084+
display_name: "Python 3.11"
2085+
variables:
2086+
PYTHON_BINARY: "/opt/python/3.11/bin/python3"
20832087
- id: "pypy3.7"
20842088
display_name: "PyPy 3.7"
20852089
variables:
@@ -2116,6 +2120,10 @@ axes:
21162120
display_name: "Python 3.10"
21172121
variables:
21182122
PYTHON_BINARY: "C:/python/Python310/python.exe"
2123+
- id: "3.11"
2124+
display_name: "Python 3.11"
2125+
variables:
2126+
PYTHON_BINARY: "C:/python/Python311/python.exe"
21192127

21202128
- id: python-version-windows-32
21212129
display_name: "Python"
@@ -2136,6 +2144,10 @@ axes:
21362144
display_name: "32-bit Python 3.10"
21372145
variables:
21382146
PYTHON_BINARY: "C:/python/32/Python310/python.exe"
2147+
- id: "3.11"
2148+
display_name: "32-bit Python 3.11"
2149+
variables:
2150+
PYTHON_BINARY: "C:/python/32/Python311/python.exe"
21392151

21402152
# Choice of mod_wsgi version
21412153
- id: mod-wsgi-version

bson/codec_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def __eq__(self, other: Any) -> Any:
199199
)
200200

201201

202-
class DatetimeConversion(enum.IntEnum):
202+
class DatetimeConversion(int, enum.Enum):
203203
"""Options for decoding BSON datetimes."""
204204

205205
DATETIME = 1

pymongo/topology_description.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def _updated_topology_description_srv_polling(topology_description, seedlist):
495495
new_hosts = set(seedlist) - set(sds.keys())
496496
n_to_add = topology_description.srv_max_hosts - len(sds)
497497
if n_to_add > 0:
498-
seedlist = sample(new_hosts, min(n_to_add, len(new_hosts)))
498+
seedlist = sample(sorted(new_hosts), min(n_to_add, len(new_hosts)))
499499
else:
500500
seedlist = []
501501
# Add SDs corresponding to servers recently added to the SRV record.

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ def build_extension(self, ext):
331331
"Programming Language :: Python :: 3.8",
332332
"Programming Language :: Python :: 3.9",
333333
"Programming Language :: Python :: 3.10",
334+
"Programming Language :: Python :: 3.11",
334335
"Programming Language :: Python :: Implementation :: CPython",
335336
"Programming Language :: Python :: Implementation :: PyPy",
336337
"Topic :: Database",

test/test_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,8 @@ def server_description_count():
16411641
# If a bug like PYTHON-2433 is reintroduced then too many
16421642
# ServerDescriptions will be kept alive and this test will fail:
16431643
# AssertionError: 19 != 46 within 15 delta (27 difference)
1644-
self.assertAlmostEqual(initial_count, final_count, delta=15)
1644+
# On Python 3.11 we seem to get more of a delta.
1645+
self.assertAlmostEqual(initial_count, final_count, delta=20)
16451646

16461647
@client_context.require_failCommand_fail_point
16471648
def test_network_error_message(self):

0 commit comments

Comments
 (0)