Skip to content

Commit 0741ae0

Browse files
authored
Make Windows a non-experimental platform in CI (#366)
* Fix various things about the benchmarks for Windows. Make Windows a non-experimental platform in CI * Increase minimum Python version for dask * Skip dask on pypy * Re-enable for PyPy * Add workaround for PyPy * Set requires Python >= 3.12 for dask
1 parent c244447 commit 0741ae0

File tree

8 files changed

+16
-11
lines changed

8 files changed

+16
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
experimental: true
5050
- os: windows-latest
5151
python: "3.13"
52-
experimental: true
52+
experimental: false
5353
steps:
5454
- uses: actions/checkout@v4
5555
- name: Set up Python ${{ matrix.python }}

doc/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
Changelog
22
=========
33

4+
* Bump dask[distributed] to 2024.10.1 for Windows compatibility
45
* Bump greenlet to 3.1.0 for compatibility with 3.13
6+
* Bump tornado to 6.2.0
57

68
Version 1.11.0 (2024-03-09)
79
--------------

pyperformance/data-files/benchmarks/bm_asyncio_websockets/run_benchmark.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pyperf
99
import websockets.server
1010
import websockets.client
11+
import websockets.exceptions
1112
import asyncio
1213

1314
CHUNK_SIZE = 1024 ** 2
@@ -23,13 +24,20 @@ async def handler(websocket) -> None:
2324
stop.set()
2425

2526

27+
async def send(ws):
28+
try:
29+
await ws.send(DATA)
30+
except websockets.exceptions.ConnectionClosedOK:
31+
pass
32+
33+
2634
async def main() -> None:
2735
global stop
2836
t0 = pyperf.perf_counter()
2937
stop = asyncio.Event()
3038
async with websockets.server.serve(handler, "", 8001):
3139
async with websockets.client.connect("ws://localhost:8001") as ws:
32-
await asyncio.gather(*[ws.send(DATA) for _ in range(100)])
40+
await asyncio.gather(*[send(ws) for _ in range(100)])
3341
await stop.wait()
3442
return pyperf.perf_counter() - t0
3543

pyperformance/data-files/benchmarks/bm_bpe_tokeniser/run_benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def train(data: str):
140140

141141
def bench_bpe_tokeniser(loops: int) -> float:
142142
DATA = Path(__file__).parent / "data" / "frankenstein_intro.txt"
143-
with open(DATA, "r") as f:
143+
with open(DATA, "r", encoding="utf8") as f:
144144
data = f.read()
145145

146146
range_it = range(loops)

pyperformance/data-files/benchmarks/bm_dask/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pyperformance_bm_dask"
3-
requires-python = ">=3.8"
3+
requires-python = ">=3.12"
44
dependencies = ["pyperf"]
55
urls = {repository = "https://github.com/python/pyperformance"}
66
dynamic = ["version"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dask[distributed]==2022.2.0
1+
dask[distributed]==2024.10.0

pyperformance/data-files/benchmarks/bm_dask/run_benchmark.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
Author: Matt Rocklin, Michael Droettboom
55
"""
66

7-
import sys
8-
97
from dask.distributed import Client, Worker, Scheduler, wait
108
from dask import distributed
119

@@ -29,9 +27,6 @@ async def benchmark():
2927

3028

3129
if __name__ == "__main__":
32-
if distributed.__version__ <= "2024.5.0" and sys.version_info >= (3, 13) and sys.platform == "win32":
33-
raise RuntimeError("Benchmark doesn't work with Python 3.13 on Windows")
34-
3530
runner = pyperf.Runner()
3631
runner.metadata['description'] = "Benchmark dask"
3732
runner.bench_async_func('dask', benchmark)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
tornado==6.1
1+
tornado==6.2

0 commit comments

Comments
 (0)