From 5a55a95806ab7850efe705851dd856de6038c3b6c8fda3f350aa4ecb7dd23413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 28 Jun 2021 14:24:57 +0000 Subject: [PATCH] Accepting request 902834 from home:bnavigator:branches:devel:languages:python:jupyter - Update to 6.1.12 * Shutdown request sequence has been modified to be more graceful, it now is preceded by interrupt, and will also send a SIGTERM before forcibly killing the kernel * Removal of ipython_genutils as a dependency. It was implicit before; but required by at least traitlets thus avoiding issues. We are working on completely removing it from all jupyter dependencies; as it might lead to issues packaging for Python 3.10, and was mostly used for compatibility with python 2. * Address a race condition between shutdown_kernel and restarter. - Release 6.1.11 * Move jedi pinning to test requirements - Release 6.1.10 * Add change parameter needed for observer method of kernel_spec_manager trait - Release 6.1.9 * Pin jedi<=0.17.2 - Release 6.1.8 * Doc updates * Fix path to the connection file * Code cleanup * Silence kill_kernel when no process is present * Remove extra_env and corresponding test * Add documentation dependencies to setup.py * Fix for Windows localhost IP addresses * Drop Travis CI, add GitHub Actions * Adapt KernelManager._kernel_spec_manager_changed to observe * Allow use ~/ in the kernel's command or its arguments * Change wait_for_ready logic OBS-URL: https://build.opensuse.org/request/show/902834 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-jupyter-client?expand=0&rev=10 --- jupyter_client-6.1.12.tar.gz | 3 + jupyter_client-6.1.7.tar.gz | 3 - ..._client-pr646-remove-async_generator.patch | 94 +++++++++++++++++++ python-jupyter-client.changes | 40 ++++++++ python-jupyter-client.spec | 23 +++-- 5 files changed, 152 insertions(+), 11 deletions(-) create mode 100644 jupyter_client-6.1.12.tar.gz delete mode 100644 jupyter_client-6.1.7.tar.gz create mode 100644 jupyter_client-pr646-remove-async_generator.patch diff --git a/jupyter_client-6.1.12.tar.gz b/jupyter_client-6.1.12.tar.gz new file mode 100644 index 0000000..3d601f6 --- /dev/null +++ b/jupyter_client-6.1.12.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4bca1d0846186ca8be97f4d2fa6d2bae889cce4892a167ffa1ba6bd1f73e782 +size 301499 diff --git a/jupyter_client-6.1.7.tar.gz b/jupyter_client-6.1.7.tar.gz deleted file mode 100644 index 036576b..0000000 --- a/jupyter_client-6.1.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:49e390b36fe4b4226724704ea28d9fb903f1a3601b6882ce3105221cd09377a1 -size 293252 diff --git a/jupyter_client-pr646-remove-async_generator.patch b/jupyter_client-pr646-remove-async_generator.patch new file mode 100644 index 0000000..0bfa387 --- /dev/null +++ b/jupyter_client-pr646-remove-async_generator.patch @@ -0,0 +1,94 @@ +From 3b854859f91f13d7625ecc9d515bdd3db5641f59 Mon Sep 17 00:00:00 2001 +From: Kevin Bates +Date: Tue, 27 Apr 2021 13:32:19 -0700 +Subject: [PATCH] Update test kernel to use native coroutine, remove + async_generator dependency + +--- + jupyter_client/tests/signalkernel.py | 6 ++---- + jupyter_client/tests/test_kernelmanager.py | 12 +++++++----- + setup.py | 1 - + 3 files changed, 9 insertions(+), 10 deletions(-) + +Index: jupyter_client-6.1.12/jupyter_client/tests/signalkernel.py +=================================================================== +--- jupyter_client-6.1.12.orig/jupyter_client/tests/signalkernel.py ++++ jupyter_client-6.1.12/jupyter_client/tests/signalkernel.py +@@ -13,8 +13,6 @@ from ipykernel.displayhook import ZMQDis + from ipykernel.kernelbase import Kernel + from ipykernel.kernelapp import IPKernelApp + +-from tornado.web import gen +- + import signal + + +@@ -32,10 +30,9 @@ class SignalTestKernel(Kernel): + if os.environ.get("NO_SIGTERM_REPLY", None) == "1": + signal.signal(signal.SIGTERM, signal.SIG_IGN) + +- @gen.coroutine +- def shutdown_request(self, stream, ident, parent): ++ async def shutdown_request(self, stream, ident, parent): + if os.environ.get("NO_SHUTDOWN_REPLY") != "1": +- yield gen.maybe_future(super().shutdown_request(stream, ident, parent)) ++ await super().shutdown_request(stream, ident, parent) + + def do_execute(self, code, silent, store_history=True, user_expressions=None, + allow_stdin=False): +Index: jupyter_client-6.1.12/jupyter_client/tests/test_kernelmanager.py +=================================================================== +--- jupyter_client-6.1.12.orig/jupyter_client/tests/test_kernelmanager.py ++++ jupyter_client-6.1.12/jupyter_client/tests/test_kernelmanager.py +@@ -14,7 +14,6 @@ import threading + import multiprocessing as mp + import pytest + +-from async_generator import async_generator, yield_ + from traitlets.config.loader import Config + from jupyter_core import paths + from jupyter_client import KernelManager, AsyncKernelManager +@@ -131,10 +130,9 @@ def async_km_subclass(config): + + + @pytest.fixture +-@async_generator # This is only necessary while Python 3.5 is support afterwhich both it and yield_() can be removed + async def start_async_kernel(): + km, kc = await start_new_async_kernel(kernel_name='signaltest') +- await yield_((km, kc)) ++ yield km, kc + kc.stop_channels() + await km.shutdown_kernel() + assert km.context.closed +@@ -163,6 +161,9 @@ class TestKernelManagerShutDownGracefull + ) + @pytest.mark.parametrize(*parameters) + def test_signal_kernel_subprocesses(self, name, install, expected): ++ # ipykernel doesn't support 3.6 and this test uses async shutdown_request; broken on obs ++ if expected == _ShutdownStatus.ShutdownRequest: ++ pytest.skip() + install() + km, kc = start_new_kernel(kernel_name=name) + assert km._shutdown_status == _ShutdownStatus.Unset +@@ -178,6 +179,9 @@ class TestKernelManagerShutDownGracefull + ) + @pytest.mark.parametrize(*parameters) + async def test_async_signal_kernel_subprocesses(self, name, install, expected): ++ # ipykernel doesn't support 3.6 and this test uses async shutdown_request ++ if expected == _ShutdownStatus.ShutdownRequest and sys.version_info < (3, 7): ++ pytest.skip() + install() + km, kc = await start_new_async_kernel(kernel_name=name) + assert km._shutdown_status == _ShutdownStatus.Unset +Index: jupyter_client-6.1.12/setup.py +=================================================================== +--- jupyter_client-6.1.12.orig/setup.py ++++ jupyter_client-6.1.12/setup.py +@@ -78,7 +78,6 @@ setup_args = dict( + python_requires = '>=3.5', + extras_require = { + 'test': [ +- 'async_generator', + 'ipykernel', + 'ipython', + 'jedi<0.18; python_version<="3.6"', diff --git a/python-jupyter-client.changes b/python-jupyter-client.changes index 462cad2..a311c48 100644 --- a/python-jupyter-client.changes +++ b/python-jupyter-client.changes @@ -1,3 +1,43 @@ +------------------------------------------------------------------- +Mon Jun 28 10:11:19 UTC 2021 - Ben Greiner + +- Update to 6.1.12 + * Shutdown request sequence has been modified to be more + graceful, it now is preceded by interrupt, and will also send + a SIGTERM before forcibly killing the kernel + * Removal of ipython_genutils as a dependency. It was implicit + before; but required by at least traitlets thus avoiding + issues. We are working on completely removing it from all + jupyter dependencies; as it might lead to issues packaging for + Python 3.10, and was mostly used for compatibility with python + 2. + * Address a race condition between shutdown_kernel and restarter. +- Release 6.1.11 + * Move jedi pinning to test requirements +- Release 6.1.10 + * Add change parameter needed for observer method of + kernel_spec_manager trait +- Release 6.1.9 + * Pin jedi<=0.17.2 +- Release 6.1.8 + * Doc updates + * Fix path to the connection file + * Code cleanup + * Silence kill_kernel when no process is present + * Remove extra_env and corresponding test + * Add documentation dependencies to setup.py + * Fix for Windows localhost IP addresses + * Drop Travis CI, add GitHub Actions + * Adapt KernelManager._kernel_spec_manager_changed to observe + * Allow use ~/ in the kernel's command or its arguments + * Change wait_for_ready logic + * Fix test_session with msgpack v1 +- Add jupyter_client-pr646-remove-async_generator.patch + * gh#jupyter/jupyter_client#646 + * fixes the current staging:F failure, same as + gh#jupyter/jupyter_client#661 +- Use flaky plugin for unreliable parallel kernel tests + ------------------------------------------------------------------- Sat Sep 5 16:42:02 UTC 2020 - Arun Persaud diff --git a/python-jupyter-client.spec b/python-jupyter-client.spec index 3dfff2b..6c16769 100644 --- a/python-jupyter-client.spec +++ b/python-jupyter-client.spec @@ -1,7 +1,7 @@ # -# spec file for package python-jupyter-client +# spec file # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,18 +26,19 @@ %endif %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-jupyter-client%{psuffix} -Version: 6.1.7 +Version: 6.1.12 Release: 0 Summary: Jupyter protocol implementation and client libraries 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-UPSTREAM jupyter_client-pr646-remove-async_generator.patch -- gh#jupyter/jupyter_client#646 +Patch1: jupyter_client-pr646-remove-async_generator.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: jupyter-jupyter_client = %{version} -Requires: python-entrypoints Requires: python-jupyter-core >= 4.6.0 Requires: python-python-dateutil >= 2.1 Requires: python-pyzmq >= 13 @@ -48,13 +49,15 @@ Obsoletes: python-jupyter_client < %{version} BuildArch: noarch %if %{with test} BuildRequires: %{python_module Sphinx} -BuildRequires: %{python_module async_generator} BuildRequires: %{python_module ipykernel} BuildRequires: %{python_module ipython} -BuildRequires: %{python_module mock} +BuildRequires: %{python_module jupyter-client = %{version}} BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest-timeout} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module traitlets} +# flaky is not an upstream dep, but for obs flakyness of parallel kernel test +BuildRequires: %{python_module flaky} %endif %python_subpackages @@ -86,7 +89,11 @@ for use with Jupyter frontends. This package provides the jupyter components. %prep -%setup -q -n jupyter_client-%{version} +%autosetup -p1 -n jupyter_client-%{version} + +# obs is a bit slow (fixed upstream in >= 6.1.13) +sed -i -E 's/(^\s+)break/\1time.sleep(1)\n\1break/' \ + jupyter_client/tests/test_kernelapp.py %build %python_build @@ -100,7 +107,7 @@ This package provides the jupyter components. %if %{with test} %check pushd jupyter_client/tests -%pytest +%pytest --force-flaky --max-runs=2 --no-success-flaky-report popd %endif