Skip to content

Commit ffb372a

Browse files
authored
PYTHON-5027 Test Windows with Python 3.14t (#2444)
1 parent 06872f7 commit ffb372a

22 files changed

+40
-31
lines changed

.evergreen/generated_configs/variants.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,15 @@ buildvariants:
319319
expansions:
320320
PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3t
321321
tags: []
322+
- name: free-threaded-win64-python3.14t
323+
tasks:
324+
- name: .free-threading
325+
display_name: Free-threaded Win64 Python3.14t
326+
run_on:
327+
- windows-64-vsMulti-small
328+
expansions:
329+
PYTHON_BINARY: C:/python/Python314/python3.14t.exe
330+
tags: []
322331

323332
# Green framework tests
324333
- name: green-eventlet-rhel8

.evergreen/scripts/generate_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ def create_free_threaded_variants() -> list[BuildVariant]:
108108
variants = []
109109
for host_name in ("rhel8", "macos", "macos-arm64", "win64"):
110110
if host_name == "win64":
111-
# TODO: PYTHON-5027
112-
continue
111+
python = "3.14t"
112+
else:
113+
python = "3.13t"
113114
tasks = [".free-threading"]
114115
tags = []
115116
if host_name == "rhel8":
116117
tags.append("pr")
117118
host = HOSTS[host_name]
118-
python = "3.13t"
119119
display_name = get_variant_name("Free-threaded", host, python=python)
120120
variant = create_variant(tasks, display_name, tags=tags, python=python, host=host)
121121
variants.append(variant)

.evergreen/scripts/generate_config_utils.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,17 @@ def get_python_binary(python: str, host: Host) -> str:
153153
base = "C:/python/32"
154154
else:
155155
base = "C:/python"
156-
python = python.replace(".", "")
157-
if python == "313t":
158-
return f"{base}/Python313/python3.13t.exe"
159-
return f"{base}/Python{python}/python.exe"
156+
python_dir = python.replace(".", "").replace("t", "")
157+
return f"{base}/Python{python_dir}/python{python}.exe"
160158

161159
if name in ["rhel8", "ubuntu22", "ubuntu20", "rhel7"]:
162160
return f"/opt/python/{python}/bin/python3"
163161

164162
if name in ["macos", "macos-arm64"]:
165-
if python == "3.13t":
166-
return "/Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3t"
167-
return f"/Library/Frameworks/Python.Framework/Versions/{python}/bin/python3"
163+
bin_name = "python3t" if "t" in python else "python3"
164+
python_dir = python.replace("t", "")
165+
framework_dir = "PythonT" if "t" in python else "Python"
166+
return f"/Library/Frameworks/{framework_dir}.Framework/Versions/{python_dir}/bin/{bin_name}"
168167

169168
raise ValueError(f"no match found for python {python} on {name}")
170169

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ filterwarnings = [
111111
"module:Wire protocol compression with:UserWarning",
112112
"module:GridIn property:DeprecationWarning",
113113
"module:GridOut property:DeprecationWarning",
114+
# pytest-asyncio known issue: https://github.com/pytest-dev/pytest-asyncio/issues/1032
115+
"module:.*WindowsSelectorEventLoopPolicy:DeprecationWarning",
116+
"module:.*et_event_loop_policy:DeprecationWarning",
114117
# TODO: Remove as part of PYTHON-3923.
115118
"module:unclosed <eventlet.green.ssl.GreenSSLSocket:ResourceWarning",
116119
"module:unclosed <socket.socket:ResourceWarning",

test/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import traceback
3131
import unittest
3232
import warnings
33-
from asyncio import iscoroutinefunction
33+
from inspect import iscoroutinefunction
3434

3535
from pymongo.errors import AutoReconnect
3636
from pymongo.synchronous.uri_parser import parse_uri

test/asynchronous/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import traceback
3131
import unittest
3232
import warnings
33-
from asyncio import iscoroutinefunction
33+
from inspect import iscoroutinefunction
3434

3535
from pymongo.asynchronous.uri_parser import parse_uri
3636
from pymongo.errors import AutoReconnect

test/asynchronous/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import traceback
3030
import unittest
3131
import warnings
32-
from asyncio import iscoroutinefunction
32+
from inspect import iscoroutinefunction
3333

3434
from pymongo._asyncio_task import create_task
3535

test/asynchronous/test_comment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import sys
2121

2222
sys.path[0:0] = [""]
23-
from asyncio import iscoroutinefunction
23+
from inspect import iscoroutinefunction
2424
from test.asynchronous import AsyncIntegrationTest, async_client_context, unittest
2525
from test.utils_shared import OvertCommandListener
2626

test/asynchronous/test_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import copy
2020
import sys
2121
import time
22-
from asyncio import iscoroutinefunction
22+
from inspect import iscoroutinefunction
2323
from io import BytesIO
2424
from test.asynchronous.helpers import ExceptionCatchingTask
2525
from typing import Any, Callable, List, Set, Tuple

test/asynchronous/unified_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import sys
2828
import time
2929
import traceback
30-
from asyncio import iscoroutinefunction
3130
from collections import defaultdict
31+
from inspect import iscoroutinefunction
3232
from test.asynchronous import (
3333
AsyncIntegrationTest,
3434
async_client_context,

0 commit comments

Comments
 (0)