Accepting request 1042422 from devel:languages:python:jupyter

- Update py3109-compat.patch to work with python 3.10.8 and lower.
- Add py3109-compat.patch to make it work with python 3.10.9.

OBS-URL: https://build.opensuse.org/request/show/1042422
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-jupyter-client?expand=0&rev=12
This commit is contained in:
Dominique Leuenberger 2022-12-12 17:59:13 +00:00 committed by Git OBS Bridge
commit 97449d8402
3 changed files with 43 additions and 0 deletions

31
py3109-compat.patch Normal file
View File

@ -0,0 +1,31 @@
Index: jupyter_client-7.3.4/jupyter_client/utils.py
===================================================================
--- jupyter_client-7.3.4.orig/jupyter_client/utils.py
+++ jupyter_client-7.3.4/jupyter_client/utils.py
@@ -6,6 +6,7 @@ utils:
import asyncio
import inspect
import os
+import sys
def run_sync(coro):
@@ -13,10 +14,14 @@ def run_sync(coro):
try:
loop = asyncio.get_running_loop()
except RuntimeError:
- # Workaround for bugs.python.org/issue39529.
- try:
- loop = asyncio.get_event_loop_policy().get_event_loop()
- except RuntimeError:
+ if sys.version_info <= (3, 10, 8):
+ # Workaround for bugs.python.org/issue39529.
+ try:
+ loop = asyncio.get_event_loop_policy().get_event_loop()
+ except RuntimeError:
+ loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(loop)
+ else:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
import nest_asyncio # type: ignore

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Dec 12 16:30:43 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- Update py3109-compat.patch to work with python 3.10.8 and lower.
-------------------------------------------------------------------
Mon Dec 12 12:34:49 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- Add py3109-compat.patch to make it work with python 3.10.9.
-------------------------------------------------------------------
Tue Jun 28 18:51:36 UTC 2022 - Ben Greiner <code@bnavigator.de>

View File

@ -34,6 +34,8 @@ License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/jupyter/jupyter_client
Source: https://files.pythonhosted.org/packages/source/j/jupyter_client/jupyter_client-%{version}.tar.gz
# PATCH-FIX-OPENSUSE py3109-compat.patch
Patch0: py3109-compat.patch
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: fdupes