From 9f5295ae2281c35a74097c9b346e697ea1e5c9e8db4097bc073896e637911d52 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 25 Jan 2022 09:33:17 +0000 Subject: [PATCH 1/2] - add distributed-fix-python310.patch to fix build with python 3.10 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-distributed?expand=0&rev=102 --- distributed-fix-python310.patch | 60 +++++++++++++++++++++++++++++++++ python-distributed.changes | 5 +++ python-distributed.spec | 3 +- 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 distributed-fix-python310.patch diff --git a/distributed-fix-python310.patch b/distributed-fix-python310.patch new file mode 100644 index 0000000..deac6f5 --- /dev/null +++ b/distributed-fix-python310.patch @@ -0,0 +1,60 @@ +From f78696ebe8d1629fd946a4606be306bd0dbadb15 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Sun, 26 Sep 2021 19:30:38 -0400 +Subject: [PATCH] Remove explicit loop from asyncio Queue + +In Python 3.5.3 and 3.6, the `get_event_loop` returned the expected +result always, so in Python 3.8, this parameter was deprecated and in +3.10 it was removed. +--- + distributed/actor.py | 7 ++++++- + distributed/tests/test_client.py | 18 ------------------ + 2 files changed, 6 insertions(+), 19 deletions(-) + +diff --git a/distributed/actor.py b/distributed/actor.py +index e99cac66b1..1dc16e1a58 100644 +--- a/distributed/actor.py ++++ b/distributed/actor.py +@@ -168,7 +168,12 @@ async def run_actor_function_on_worker(): + raise OSError("Unable to contact Actor's worker") + return result + +- q = asyncio.Queue(loop=self._io_loop.asyncio_loop) ++ loop = asyncio.get_event_loop() ++ try: ++ asyncio.set_event_loop(self._io_loop.asyncio_loop) ++ q = asyncio.Queue() ++ finally: ++ asyncio.set_event_loop(loop) + + async def wait_then_add_to_queue(): + x = await run_actor_function_on_worker() +diff --git a/distributed/tests/test_client.py b/distributed/tests/test_client.py +index 456485f0ca..88bf18b60f 100644 +--- a/distributed/tests/test_client.py ++++ b/distributed/tests/test_client.py +@@ -6301,24 +6301,6 @@ async def f(stacklevel, mode=None): + assert "cdn.bokeh.org" in data + + +-@gen_cluster(nthreads=[]) +-async def test_client_gather_semaphore_loop(s): +- async with Client(s.address, asynchronous=True) as c: +- assert c._gather_semaphore._loop is c.loop.asyncio_loop +- +- +-@gen_cluster(client=True) +-async def test_as_completed_condition_loop(c, s, a, b): +- seq = c.map(inc, range(5)) +- ac = as_completed(seq) +- assert ac.condition._loop == c.loop.asyncio_loop +- +- +-def test_client_connectionpool_semaphore_loop(s, a, b): +- with Client(s["address"]) as c: +- assert c.rpc.semaphore._loop is c.loop.asyncio_loop +- +- + @pytest.mark.slow + @gen_cluster(nthreads=[], timeout=60) + async def test_mixed_compression(s): diff --git a/python-distributed.changes b/python-distributed.changes index edc5137..236e092 100644 --- a/python-distributed.changes +++ b/python-distributed.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jan 25 09:33:04 UTC 2022 - Dirk Müller + +- add distributed-fix-python310.patch to fix build with python 3.10 + ------------------------------------------------------------------- Thu Jan 20 16:09:54 UTC 2022 - Ben Greiner diff --git a/python-distributed.spec b/python-distributed.spec index 9ed6a18..bef6677 100644 --- a/python-distributed.spec +++ b/python-distributed.spec @@ -37,8 +37,6 @@ %bcond_without test %endif %if "%{flavor}" == "" -# https://github.com/dask/distributed/issues/5350 -%define skip_python310 1 %bcond_with test %endif @@ -64,6 +62,7 @@ License: BSD-3-Clause URL: https://distributed.readthedocs.io/en/latest/ Source: https://github.com/dask/distributed/archive/refs/tags//%{ghversiontag}.tar.gz#/distributed-%{ghversiontag}-gh.tar.gz Source99: python-distributed-rpmlintrc +Patch1: distributed-fix-python310.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module setuptools} BuildRequires: fdupes From f70ad21c71d1dba0ea6cc3b3465bf35bdd471bff37bcbbe88d9f5aae7dc6df3b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 25 Jan 2022 22:06:23 +0000 Subject: [PATCH 2/2] Accepting request 949113 from home:bnavigator:branches:devel:languages:python:numeric Not required to forward to Factory, this is a revert OBS-URL: https://build.opensuse.org/request/show/949113 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-distributed?expand=0&rev=103 --- _multibuild | 1 + distributed-fix-python310.patch | 60 --------------------------------- python-distributed.changes | 9 +++++ python-distributed.spec | 4 ++- 4 files changed, 13 insertions(+), 61 deletions(-) delete mode 100644 distributed-fix-python310.patch diff --git a/_multibuild b/_multibuild index e9bd620..9bbe6ad 100644 --- a/_multibuild +++ b/_multibuild @@ -1,4 +1,5 @@ test-py38 test-py39 + diff --git a/distributed-fix-python310.patch b/distributed-fix-python310.patch deleted file mode 100644 index deac6f5..0000000 --- a/distributed-fix-python310.patch +++ /dev/null @@ -1,60 +0,0 @@ -From f78696ebe8d1629fd946a4606be306bd0dbadb15 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Sun, 26 Sep 2021 19:30:38 -0400 -Subject: [PATCH] Remove explicit loop from asyncio Queue - -In Python 3.5.3 and 3.6, the `get_event_loop` returned the expected -result always, so in Python 3.8, this parameter was deprecated and in -3.10 it was removed. ---- - distributed/actor.py | 7 ++++++- - distributed/tests/test_client.py | 18 ------------------ - 2 files changed, 6 insertions(+), 19 deletions(-) - -diff --git a/distributed/actor.py b/distributed/actor.py -index e99cac66b1..1dc16e1a58 100644 ---- a/distributed/actor.py -+++ b/distributed/actor.py -@@ -168,7 +168,12 @@ async def run_actor_function_on_worker(): - raise OSError("Unable to contact Actor's worker") - return result - -- q = asyncio.Queue(loop=self._io_loop.asyncio_loop) -+ loop = asyncio.get_event_loop() -+ try: -+ asyncio.set_event_loop(self._io_loop.asyncio_loop) -+ q = asyncio.Queue() -+ finally: -+ asyncio.set_event_loop(loop) - - async def wait_then_add_to_queue(): - x = await run_actor_function_on_worker() -diff --git a/distributed/tests/test_client.py b/distributed/tests/test_client.py -index 456485f0ca..88bf18b60f 100644 ---- a/distributed/tests/test_client.py -+++ b/distributed/tests/test_client.py -@@ -6301,24 +6301,6 @@ async def f(stacklevel, mode=None): - assert "cdn.bokeh.org" in data - - --@gen_cluster(nthreads=[]) --async def test_client_gather_semaphore_loop(s): -- async with Client(s.address, asynchronous=True) as c: -- assert c._gather_semaphore._loop is c.loop.asyncio_loop -- -- --@gen_cluster(client=True) --async def test_as_completed_condition_loop(c, s, a, b): -- seq = c.map(inc, range(5)) -- ac = as_completed(seq) -- assert ac.condition._loop == c.loop.asyncio_loop -- -- --def test_client_connectionpool_semaphore_loop(s, a, b): -- with Client(s["address"]) as c: -- assert c.rpc.semaphore._loop is c.loop.asyncio_loop -- -- - @pytest.mark.slow - @gen_cluster(nthreads=[], timeout=60) - async def test_mixed_compression(s): diff --git a/python-distributed.changes b/python-distributed.changes index 236e092..16f1e88 100644 --- a/python-distributed.changes +++ b/python-distributed.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Jan 25 18:29:23 UTC 2022 - Ben Greiner + +- Revert distributed-fix-python310.patch addition +- The patch is gh#dask/distributed#5353 + * Is not merged upstream + * Does not fix the issues + * Breaks other flavors + ------------------------------------------------------------------- Tue Jan 25 09:33:04 UTC 2022 - Dirk Müller diff --git a/python-distributed.spec b/python-distributed.spec index bef6677..046f7c2 100644 --- a/python-distributed.spec +++ b/python-distributed.spec @@ -31,12 +31,15 @@ %bcond_without test %endif %if "%{flavor}" == "test-py310" +# add to _multibuild when enabling python310 (see below) %define psuffix -test-py310" %define skip_python38 1 %define skip_python39 1 %bcond_without test %endif %if "%{flavor}" == "" +# https://github.com/dask/distributed/issues/5350 -- NOT fixed by https://github.com/dask/distributed/pull/5353 +%define skip_python310 1 %bcond_with test %endif @@ -62,7 +65,6 @@ License: BSD-3-Clause URL: https://distributed.readthedocs.io/en/latest/ Source: https://github.com/dask/distributed/archive/refs/tags//%{ghversiontag}.tar.gz#/distributed-%{ghversiontag}-gh.tar.gz Source99: python-distributed-rpmlintrc -Patch1: distributed-fix-python310.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module setuptools} BuildRequires: fdupes