diff --git a/distributed/client.py b/distributed/client.py index 0d41254a044..162f4f6169f 100644 --- a/distributed/client.py +++ b/distributed/client.py @@ -1237,20 +1237,6 @@ def __init__( ReplayTaskClient(self) - @property - def io_loop(self) -> IOLoop | None: - warnings.warn( - "The io_loop property is deprecated", DeprecationWarning, stacklevel=2 - ) - return self.loop - - @io_loop.setter - def io_loop(self, value: IOLoop) -> None: - warnings.warn( - "The io_loop property is deprecated", DeprecationWarning, stacklevel=2 - ) - self.loop = value - @property def loop(self) -> IOLoop | None: loop = self.__loop @@ -1262,13 +1248,6 @@ def loop(self) -> IOLoop | None: self.__loop = loop = self._loop_runner.loop return loop - @loop.setter - def loop(self, value: IOLoop) -> None: - warnings.warn( - "setting the loop property is deprecated", DeprecationWarning, stacklevel=2 - ) - self.__loop = value - @contextmanager def as_current(self): """Thread-local, Task-local context manager that causes the Client.current diff --git a/distributed/core.py b/distributed/core.py index dc5f7733fe7..780f6a16958 100644 --- a/distributed/core.py +++ b/distributed/core.py @@ -238,7 +238,6 @@ def __init__( deserializers=None, connection_args=None, timeout=None, - io_loop=None, local_directory=None, needs_workdir=True, ): @@ -274,13 +273,6 @@ def __init__( sys.path.insert(0, self.local_directory) self._updated_sys_path = True - if io_loop is not None: - warnings.warn( - "The io_loop kwarg to Server is ignored and will be deprecated", - DeprecationWarning, - stacklevel=2, - ) - self._status = Status.init self.handlers = { "identity": self.identity, diff --git a/distributed/deploy/cluster.py b/distributed/deploy/cluster.py index 7b68f671144..7d14b05ff91 100644 --- a/distributed/deploy/cluster.py +++ b/distributed/deploy/cluster.py @@ -104,15 +104,6 @@ def loop(self) -> IOLoop | None: self.__loop = loop = self._loop_runner.loop return loop - @loop.setter - def loop(self, value: IOLoop) -> None: - warnings.warn( - "setting the loop property is deprecated", DeprecationWarning, stacklevel=2 - ) - if value is None: - raise ValueError("expected an IOLoop, got None") - self.__loop = value - @property def called_from_running_loop(self): try: diff --git a/distributed/deploy/tests/test_cluster.py b/distributed/deploy/tests/test_cluster.py index ec3512d0b47..023518d51bc 100644 --- a/distributed/deploy/tests/test_cluster.py +++ b/distributed/deploy/tests/test_cluster.py @@ -1,7 +1,6 @@ from __future__ import annotations import pytest -from tornado.ioloop import IOLoop from distributed import LocalCluster, Status from distributed.deploy.cluster import Cluster, _exponential_backoff @@ -51,22 +50,6 @@ async def test_cluster_wait_for_worker(): assert len(cluster.scheduler.workers) == 4 -@gen_test() -async def test_deprecated_loop_properties(): - class ExampleCluster(Cluster): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.loop = self.io_loop = IOLoop.current() - - with pytest.warns(DeprecationWarning) as warninfo: - async with ExampleCluster(asynchronous=True, loop=IOLoop.current()): - pass - - assert [(w.category, *w.message.args) for w in warninfo] == [ - (DeprecationWarning, "setting the loop property is deprecated") - ] - - def test_exponential_backoff(): assert _exponential_backoff(0, 1.5, 3, 20) == 1.5 assert _exponential_backoff(1, 1.5, 3, 20) == 4.5 diff --git a/distributed/diagnostics/progressbar.py b/distributed/diagnostics/progressbar.py index 8c1e7e20e49..bc906495793 100644 --- a/distributed/diagnostics/progressbar.py +++ b/distributed/diagnostics/progressbar.py @@ -145,13 +145,6 @@ def loop(self) -> IOLoop | None: self.__loop = loop = self._loop_runner.loop return loop - @loop.setter - def loop(self, value: IOLoop) -> None: - warnings.warn( - "setting the loop property is deprecated", DeprecationWarning, stacklevel=2 - ) - self.__loop = value - def _draw_bar(self, remaining, all, **kwargs): frac = (1 - remaining / all) if all else 1.0 bar = "#" * int(self.width * frac) diff --git a/distributed/diagnostics/tests/test_progressbar.py b/distributed/diagnostics/tests/test_progressbar.py index 7874457a2c6..bec5d9db582 100644 --- a/distributed/diagnostics/tests/test_progressbar.py +++ b/distributed/diagnostics/tests/test_progressbar.py @@ -3,7 +3,6 @@ from time import sleep import pytest -from tornado.ioloop import IOLoop from distributed.diagnostics.progressbar import TextProgressBar, progress from distributed.metrics import time @@ -85,18 +84,3 @@ def test_progress_function_warns(client): def test_progress_function_raises(): with pytest.raises(ValueError, match="`group_by` should be "): progress(None, group_by="incorrect") - - -@gen_cluster(client=True, nthreads=[]) -async def test_deprecated_loop_properties(c, s): - class ExampleTextProgressBar(TextProgressBar): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.loop = self.io_loop = IOLoop.current() - - with pytest.warns(DeprecationWarning) as warninfo: - ExampleTextProgressBar(client=c, keys=[], start=False, loop=IOLoop.current()) - - assert [(w.category, *w.message.args) for w in warninfo] == [ - (DeprecationWarning, "setting the loop property is deprecated") - ] diff --git a/distributed/nanny.py b/distributed/nanny.py index 4d54666b63c..1a4da5bdd75 100644 --- a/distributed/nanny.py +++ b/distributed/nanny.py @@ -127,7 +127,6 @@ def __init__( # type: ignore[no-untyped-def] scheduler_file=None, worker_port: int | str | Collection[int] | None = 0, nthreads=None, - loop=None, local_directory=None, services=None, name=None, @@ -154,14 +153,6 @@ def __init__( # type: ignore[no-untyped-def] config=None, **worker_kwargs, ): - if loop is not None: - warnings.warn( - "the `loop` kwarg to `Nanny` is ignored, and will be removed in a future release. " - "The Nanny always binds to the current loop.", - DeprecationWarning, - stacklevel=2, - ) - self.__exit_stack = stack = contextlib.ExitStack() self.process = None self._setup_logging(logger) diff --git a/distributed/scheduler.py b/distributed/scheduler.py index b7c5aabacb7..a8740abab58 100644 --- a/distributed/scheduler.py +++ b/distributed/scheduler.py @@ -3924,7 +3924,7 @@ class Scheduler(SchedulerState, ServerNode): def __init__( self, - loop: IOLoop | None = None, + *, services: dict | None = None, service_kwargs: dict | None = None, allowed_failures: int | None = None, @@ -3953,12 +3953,6 @@ def __init__( raise RuntimeError( "Pickling can no longer be disabled with the `distributed.scheduler.pickle` option. Please remove this configuration to start the scheduler." ) - if loop is not None: - warnings.warn( - "the loop kwarg to Scheduler is deprecated", - DeprecationWarning, - stacklevel=2, - ) self.loop = self.io_loop = IOLoop.current() self._setup_logging(logger) diff --git a/distributed/tests/test_client.py b/distributed/tests/test_client.py index 5882d6bae7b..a459a08cbde 100644 --- a/distributed/tests/test_client.py +++ b/distributed/tests/test_client.py @@ -38,7 +38,6 @@ import yaml from packaging.version import parse as parse_version from tlz import concat, first, identity, isdistinct, merge, pluck, valmap -from tornado.ioloop import IOLoop import dask import dask.bag as db @@ -8024,24 +8023,6 @@ def test_quiet_close_process(processes, tmp_path): assert not lines -@gen_cluster(client=False, nthreads=[]) -async def test_deprecated_loop_properties(s): - class ExampleClient(Client): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.loop = self.io_loop = IOLoop.current() - - with pytest.warns(DeprecationWarning) as warninfo: - async with ExampleClient(s.address, asynchronous=True, loop=IOLoop.current()): - pass - - assert [(w.category, *w.message.args) for w in warninfo] == [ - (DeprecationWarning, "setting the loop property is deprecated"), - (DeprecationWarning, "The io_loop property is deprecated"), - (DeprecationWarning, "setting the loop property is deprecated"), - ] - - @gen_cluster(client=False, nthreads=[]) async def test_fast_close_on_aexit_failure(s): class MyException(Exception): diff --git a/distributed/tests/test_scheduler.py b/distributed/tests/test_scheduler.py index e2f714e1c68..83c37fdc7bd 100644 --- a/distributed/tests/test_scheduler.py +++ b/distributed/tests/test_scheduler.py @@ -20,7 +20,6 @@ import psutil import pytest from tlz import concat, first, merge -from tornado.ioloop import IOLoop import dask from dask import bag, delayed @@ -1450,15 +1449,6 @@ async def test_update_graph_culls(s, a, b): assert "z" not in s.tasks -@gen_test() -async def test_io_loop(loop): - with pytest.warns( - DeprecationWarning, match=r"the loop kwarg to Scheduler is deprecated" - ): - s = Scheduler(loop=loop, dashboard_address=":0", validate=True) - assert s.io_loop is IOLoop.current() - - @gen_cluster(client=True) async def test_story(c, s, a, b): x = delayed(inc)(1) diff --git a/distributed/tests/test_worker.py b/distributed/tests/test_worker.py index acca4423416..230dab9bdb0 100644 --- a/distributed/tests/test_worker.py +++ b/distributed/tests/test_worker.py @@ -22,7 +22,6 @@ import psutil import pytest from tlz import first, pluck, sliding_window -from tornado.ioloop import IOLoop import dask from dask import delayed @@ -592,17 +591,6 @@ async def test_io_loop(s): assert w.io_loop is w.loop is s.loop -@gen_cluster(nthreads=[]) -async def test_io_loop_alternate_loop(s, loop): - with pytest.warns( - DeprecationWarning, - match=r"The `loop` argument to `Worker` is ignored, and will be " - r"removed in a future release. The Worker always binds to the current loop", - ): - async with Worker(s.address, loop=loop) as w: - assert w.io_loop is w.loop is IOLoop.current() - - @gen_cluster(client=True) async def test_access_key(c, s, a, b): def f(i): diff --git a/distributed/worker.py b/distributed/worker.py index 79f24b22da6..8948e2d8974 100644 --- a/distributed/worker.py +++ b/distributed/worker.py @@ -492,7 +492,6 @@ def __init__( *, scheduler_file: str | None = None, nthreads: int | None = None, - loop: IOLoop | None = None, # Deprecated local_directory: str | None = None, services: dict | None = None, name: Any | None = None, @@ -558,13 +557,7 @@ def __init__( DeprecationWarning, stacklevel=2, ) - if loop is not None: - warnings.warn( - "The `loop` argument to `Worker` is ignored, and will be removed in a future release. " - "The Worker always binds to the current loop", - DeprecationWarning, - stacklevel=2, - ) + self.__exit_stack = stack = contextlib.ExitStack() self.nanny = nanny self._lock = threading.Lock()