Skip to content

Commit cfc886b

Browse files
committed
Add Python 3.14 to CI matrix
1 parent 20612be commit cfc886b

File tree

4 files changed

+14
-22
lines changed

4 files changed

+14
-22
lines changed

.github/workflows/nox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
platform: [ubuntu-latest, macos-latest, windows-latest]
15-
python-version: ["3.11", "3.12", "3.13"]
15+
python-version: ["3.11", "3.12", "3.13", "3.14"]
1616

1717
steps:
1818
- uses: actions/checkout@v4

adaptive/tests/test_runner.py

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -266,33 +266,24 @@ def counting_ask(self, n, tell_pending=True):
266266
Learner1D.ask = original_ask
267267

268268

269-
def test_async_runner_without_event_loop():
270-
"""Test that AsyncRunner works when no event loop exists.
269+
def test_async_runner_without_running_event_loop():
270+
"""Test that AsyncRunner works when no event loop is running.
271271
272272
In Python 3.10+, asyncio.get_event_loop() was deprecated when no running
273273
event loop exists. In Python 3.12+ it emits a DeprecationWarning, and in
274274
Python 3.14+ it raises a RuntimeError.
275275
276276
This test ensures AsyncRunner properly handles the case when no event
277-
loop exists by creating one.
277+
loop is running by creating one.
278278
279279
Regression test for: https://github.com/python-adaptive/adaptive/issues/489
280280
"""
281+
# Ensure no event loop is currently running
282+
with pytest.raises(RuntimeError, match="no running event loop"):
283+
asyncio.get_running_loop()
281284

282-
def run_in_thread():
283-
"""Run AsyncRunner in a thread with no event loop."""
284-
# Ensure no event loop exists in this thread
285-
with pytest.raises(RuntimeError, match="no.*event loop"):
286-
asyncio.get_running_loop()
287-
288-
# AsyncRunner should still work - it should create its own event loop
289-
learner = Learner1D(linear, (-1, 1))
290-
runner = AsyncRunner(learner, npoints_goal=10, executor=SequentialExecutor())
291-
runner.block_until_done()
292-
assert learner.npoints >= 10
293-
294-
import threading
295-
296-
thread = threading.Thread(target=run_in_thread)
297-
thread.start()
298-
thread.join()
285+
# AsyncRunner should still work - it should create its own event loop
286+
learner = Learner1D(linear, (-1, 1))
287+
runner = AsyncRunner(learner, npoints_goal=10, executor=SequentialExecutor())
288+
runner.block_until_done()
289+
assert learner.npoints >= 10

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
nox.options.default_venv_backend = "uv"
88

9-
python = ["3.11", "3.12", "3.13"]
9+
python = ["3.11", "3.12", "3.13", "3.14"]
1010
num_cpus = os.cpu_count() or 1
1111
xdist = ("-n", "auto") if num_cpus > 2 else ()
1212

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ classifiers = [
1616
"Programming Language :: Python :: 3.11",
1717
"Programming Language :: Python :: 3.12",
1818
"Programming Language :: Python :: 3.13",
19+
"Programming Language :: Python :: 3.14",
1920
]
2021
dependencies = [
2122
"scipy",

0 commit comments

Comments
 (0)