From a74fd3812f20abcb09647a609381ca57a244e623 Mon Sep 17 00:00:00 2001 From: James Bourbeau Date: Thu, 31 Mar 2022 01:35:14 -0500 Subject: [PATCH] Remove support for PyPy (#6029) --- distributed/compatibility.py | 2 -- distributed/tests/test_spill.py | 2 -- distributed/utils_perf.py | 9 --------- docs/source/protocol.rst | 6 ++---- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/distributed/compatibility.py b/distributed/compatibility.py index f015126786..ca49f7b0b2 100644 --- a/distributed/compatibility.py +++ b/distributed/compatibility.py @@ -1,14 +1,12 @@ from __future__ import annotations import logging -import platform import sys logging_names: dict[str | int, int | str] = {} logging_names.update(logging._levelToName) # type: ignore logging_names.update(logging._nameToLevel) # type: ignore -PYPY = platform.python_implementation().lower() == "pypy" LINUX = sys.platform == "linux" MACOS = sys.platform == "darwin" WINDOWS = sys.platform.startswith("win") diff --git a/distributed/tests/test_spill.py b/distributed/tests/test_spill.py index 2581701aa1..6ab595933e 100644 --- a/distributed/tests/test_spill.py +++ b/distributed/tests/test_spill.py @@ -1,6 +1,5 @@ from __future__ import annotations -import gc import logging import os import uuid @@ -338,7 +337,6 @@ def test_weakref_cache(tmpdir, cls, expect_cached, size): # the same id as a deleted one id_x = x.id del x - gc.collect() # Only needed on pypy if size < 100: buf["y"] diff --git a/distributed/utils_perf.py b/distributed/utils_perf.py index 6643b738b9..41ff877dbc 100644 --- a/distributed/utils_perf.py +++ b/distributed/utils_perf.py @@ -5,7 +5,6 @@ from dask.utils import format_bytes -from distributed.compatibility import PYPY from distributed.metrics import thread_time logger = _logger = logging.getLogger(__name__) @@ -144,8 +143,6 @@ def __init__(self, warn_over_frac=0.1, info_over_rss_win=10 * 1e6): self._enabled = False def enable(self): - if PYPY: - return assert not self._enabled self._fractional_timer = FractionalTimer(n_samples=self.N_SAMPLES) try: @@ -162,8 +159,6 @@ def enable(self): self._enabled = True def disable(self): - if PYPY: - return assert self._enabled gc.callbacks.remove(self._gc_callback) self._enabled = False @@ -229,8 +224,6 @@ def enable_gc_diagnosis(): """ Ask to enable global GC diagnosis. """ - if PYPY: - return global _gc_diagnosis_users with _gc_diagnosis_lock: if _gc_diagnosis_users == 0: @@ -244,8 +237,6 @@ def disable_gc_diagnosis(force=False): """ Ask to disable global GC diagnosis. """ - if PYPY: - return global _gc_diagnosis_users with _gc_diagnosis_lock: if _gc_diagnosis_users > 0: diff --git a/docs/source/protocol.rst b/docs/source/protocol.rst index 334e2c0e4b..9f5d499090 100644 --- a/docs/source/protocol.rst +++ b/docs/source/protocol.rst @@ -135,13 +135,11 @@ the scheduler may differ.** This has a few advantages: 1. The Scheduler is protected from unpickling unsafe code -2. The Scheduler can be run under ``pypy`` for improved performance. This is - only useful for larger clusters. -3. We could conceivably implement workers and clients for other languages +2. We could conceivably implement workers and clients for other languages (like R or Julia) and reuse the Python scheduler. The worker and client code is fairly simple and much easier to reimplement than the scheduler, which is complex. -4. The scheduler might some day be rewritten in more heavily optimized C or Go +3. The scheduler might some day be rewritten in more heavily optimized C or Go Compression -----------