Hello community, here is the log from the commit of package python-pyviz-comms for openSUSE:Factory checked in at 2020-07-16 12:15:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyviz-comms (Old) and /work/SRC/openSUSE:Factory/.python-pyviz-comms.new.3592 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyviz-comms" Thu Jul 16 12:15:32 2020 rev:6 rq:820957 version:0.7.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyviz-comms/python-pyviz-comms.changes 2020-06-09 00:05:41.629509833 +0200 +++ /work/SRC/openSUSE:Factory/.python-pyviz-comms.new.3592/python-pyviz-comms.changes 2020-07-16 12:16:48.198864656 +0200 @@ -1,0 +2,8 @@ +Tue Jul 14 15:02:40 UTC 2020 - Marketa Calabkova <[email protected]> + +- Update to 0.7.6 + * Fix compatibility with older browsers + * Add support for comms in Google Colab + * Add on_open callbacks to comms + +------------------------------------------------------------------- Old: ---- pyviz_comms-0.7.4.tar.gz New: ---- pyviz_comms-0.7.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyviz-comms.spec ++++++ --- /var/tmp/diff_new_pack.KyMF8I/_old 2020-07-16 12:16:51.410867903 +0200 +++ /var/tmp/diff_new_pack.KyMF8I/_new 2020-07-16 12:16:51.414867908 +0200 @@ -18,23 +18,22 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pyviz-comms -Version: 0.7.4 +Version: 0.7.6 Release: 0 Summary: Tool to launch jobs, organize the output, and dissect the results License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/pyviz/pyviz_comms -Source0: https://files.pythonhosted.org/packages/source/p/pyviz-comms/pyviz_comms-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/p/pyviz_comms/pyviz_comms-%{version}.tar.gz Source100: python-pyviz-comms-rpmlintrc BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-param >= 1.6.0 +BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module param >= 1.6.0} # /SECTION -Requires: python-param >= 1.6.0 -BuildArch: noarch - %python_subpackages %description ++++++ pyviz_comms-0.7.4.tar.gz -> pyviz_comms-0.7.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.7.4/PKG-INFO new/pyviz_comms-0.7.6/PKG-INFO --- old/pyviz_comms-0.7.4/PKG-INFO 2020-03-10 14:38:06.000000000 +0100 +++ new/pyviz_comms-0.7.6/PKG-INFO 2020-07-07 13:02:52.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyviz_comms -Version: 0.7.4 +Version: 0.7.6 Summary: Bidirectional communication for the PyViz ecosystem. Home-page: http://pyviz.org Author: PyViz developers @@ -10,12 +10,13 @@ License: BSD Description: # pyviz_comms - Offers a simple bidirectional communication architecture for PyViz tools - including support for Jupyter comms in both the classic notebook and - Jupyterlab. + Offers a simple bidirectional communication architecture between Python and JavaScript, + with support for Jupyter comms in both the classic notebook and Jupyterlab. + Available for use by any [PyViz](https://pyviz.org) tool, but currently primarily used by + [HoloViz](https://holoviz.org) tools. There are two installable components in this repository: a Python - component used by various PyViz tools and an extension to enable + component used by various HoloViz tools and an extension to enable Jupyterlab support. ## Installing the Jupyterlab extension @@ -28,7 +29,7 @@ ## Compatibility - The [PyViz](https://github.com/pyviz/pyviz) libraries are generally version independent of + The [Holoviz](https://github.com/holoviz/holoviz) libraries are generally version independent of [JupyterLab](https://github.com/jupyterlab/jupyterlab) and the ``jupyterlab_pyviz`` extension has been supported since holoviews 1.10.0 and the first release of ``pyviz_comms``. @@ -46,7 +47,7 @@ | 0.34.x | 0.6.1-0.6.2 | | 0.35.x | 0.6.3-0.7.2 | | 1.0.x | 0.8.0 | - | 2.0.x | 0.9.0 | + | 2.0.x | 0.9.0-1.0.3 | ## Developing the Jupyterlab extension @@ -66,7 +67,7 @@ ## The ``pyviz_comms`` Python package - The ``pyviz_comms`` Python package is used by pyviz projects and can be + The ``pyviz_comms`` Python package is used by holoviz projects and can be pip and conda installed. Platform: Windows diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.7.4/README.md new/pyviz_comms-0.7.6/README.md --- old/pyviz_comms-0.7.4/README.md 2020-03-10 14:37:04.000000000 +0100 +++ new/pyviz_comms-0.7.6/README.md 2020-07-07 13:01:47.000000000 +0200 @@ -1,11 +1,12 @@ # pyviz_comms -Offers a simple bidirectional communication architecture for PyViz tools -including support for Jupyter comms in both the classic notebook and -Jupyterlab. +Offers a simple bidirectional communication architecture between Python and JavaScript, +with support for Jupyter comms in both the classic notebook and Jupyterlab. +Available for use by any [PyViz](https://pyviz.org) tool, but currently primarily used by +[HoloViz](https://holoviz.org) tools. There are two installable components in this repository: a Python -component used by various PyViz tools and an extension to enable +component used by various HoloViz tools and an extension to enable Jupyterlab support. ## Installing the Jupyterlab extension @@ -18,7 +19,7 @@ ## Compatibility -The [PyViz](https://github.com/pyviz/pyviz) libraries are generally version independent of +The [Holoviz](https://github.com/holoviz/holoviz) libraries are generally version independent of [JupyterLab](https://github.com/jupyterlab/jupyterlab) and the ``jupyterlab_pyviz`` extension has been supported since holoviews 1.10.0 and the first release of ``pyviz_comms``. @@ -36,7 +37,7 @@ | 0.34.x | 0.6.1-0.6.2 | | 0.35.x | 0.6.3-0.7.2 | | 1.0.x | 0.8.0 | -| 2.0.x | 0.9.0 | +| 2.0.x | 0.9.0-1.0.3 | ## Developing the Jupyterlab extension @@ -56,5 +57,5 @@ ## The ``pyviz_comms`` Python package -The ``pyviz_comms`` Python package is used by pyviz projects and can be +The ``pyviz_comms`` Python package is used by holoviz projects and can be pip and conda installed. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.7.4/pyviz_comms/.version new/pyviz_comms-0.7.6/pyviz_comms/.version --- old/pyviz_comms-0.7.4/pyviz_comms/.version 2020-03-10 14:38:06.000000000 +0100 +++ new/pyviz_comms-0.7.6/pyviz_comms/.version 2020-07-07 13:02:52.000000000 +0200 @@ -1 +1 @@ -{"git_describe": "v0.7.4-0-gdeae0d5", "version_string": "0.7.4"} \ No newline at end of file +{"git_describe": "v0.7.6-0-g6b7eb90", "version_string": "0.7.6"} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.7.4/pyviz_comms/__init__.py new/pyviz_comms-0.7.6/pyviz_comms/__init__.py --- old/pyviz_comms-0.7.4/pyviz_comms/__init__.py 2020-03-10 14:37:04.000000000 +0100 +++ new/pyviz_comms-0.7.6/pyviz_comms/__init__.py 2020-07-07 13:01:47.000000000 +0200 @@ -254,13 +254,14 @@ js_template = '' - def __init__(self, id=None, on_msg=None, on_error=None, on_stdout=None): + def __init__(self, id=None, on_msg=None, on_error=None, on_stdout=None, on_open=None): """ Initializes a Comms object """ self._on_msg = on_msg self._on_error = on_error self._on_stdout = on_stdout + self._on_open = on_open self._comm = None super(Comm, self).__init__(id = id if id else uuid.uuid4().hex) @@ -325,7 +326,7 @@ pass error = '\n' frames = traceback.extract_tb(sys.exc_info()[2]) - for frame in frames[-10:]: + for frame in frames[-20:]: fname,lineno,fn,text = frame error_kwargs = dict(fn=fn, fname=fname, line=lineno) error += '{fname} {fn} L{line}\n'.format(**error_kwargs) @@ -379,6 +380,8 @@ return self._comm = IPyComm(target_name=self.id, data={}) self._comm.on_msg(self._handle_msg) + if self._on_open: + self._on_open({}) @classmethod @@ -427,16 +430,15 @@ </script> """ - def __init__(self, id=None, on_msg=None, on_error=None, on_stdout=None): + def __init__(self, id=None, on_msg=None, on_error=None, on_stdout=None, on_open=None): """ Initializes a Comms object """ from IPython import get_ipython - super(JupyterCommJS, self).__init__(id, on_msg, on_error, on_stdout) + super(JupyterCommJS, self).__init__(id, on_msg, on_error, on_stdout, on_open) self.manager = get_ipython().kernel.comm_manager self.manager.register_target(self.id, self._handle_open) - def close(self): """ Closes the comm connection @@ -449,11 +451,11 @@ else: raise AssertionError('JupyterCommJS %s is already closed' % self.id) - def _handle_open(self, comm, msg): self._comm = comm self._comm.on_msg(self._handle_msg) - + if self._on_open: + self._on_open(msg) def send(self, data=None, metadata=None, buffers=[]): """ @@ -489,14 +491,14 @@ client_comm = Comm @classmethod - def get_server_comm(cls, on_msg=None, id=None, on_error=None, on_stdout=None): - comm = cls.server_comm(id, on_msg, on_error, on_stdout) + def get_server_comm(cls, on_msg=None, id=None, on_error=None, on_stdout=None, on_open=None): + comm = cls.server_comm(id, on_msg, on_error, on_stdout, on_open) cls._comms[comm.id] = comm return comm @classmethod - def get_client_comm(cls, on_msg=None, id=None, on_error=None, on_stdout=None): - comm = cls.client_comm(id, on_msg, on_error, on_stdout) + def get_client_comm(cls, on_msg=None, id=None, on_error=None, on_stdout=None, on_open=None): + comm = cls.client_comm(id, on_msg, on_error, on_stdout, on_open) cls._comms[comm.id] = comm return comm @@ -530,6 +532,24 @@ window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) { comm.onMsg = msg_handler; }); + } else if (typeof google != 'undefined' && google.colab.kernel != null) { + google.colab.kernel.comms.registerTarget(comm_id, (comm) => { + var messages = comm.messages[Symbol.asyncIterator](); + function processIteratorResult(result) { + var message = result.value; + console.log(message) + var content = {data: message.data, comm_id}; + var buffers = [] + for (var buffer of message.buffers || []) { + buffers.push(new DataView(buffer)) + } + var metadata = message.metadata || {}; + var msg = {content, buffers, metadata} + msg_handler(msg); + return messages.next().then(processIteratorResult); + } + return messages.next().then(processIteratorResult); + }) } } @@ -548,12 +568,35 @@ if (msg_handler) { comm.onMsg = msg_handler; } + } else if (typeof google != 'undefined' && google.colab.kernel != null) { + var comm_promise = google.colab.kernel.comms.open(comm_id) + comm_promise.then((comm) => { + window.PyViz.comms[comm_id] = comm; + if (msg_handler) { + var messages = comm.messages[Symbol.asyncIterator](); + function processIteratorResult(result) { + var message = result.value; + var content = {data: message.data}; + var metadata = message.metadata || {comm_id}; + var msg = {content, metadata} + msg_handler(msg); + return messages.next().then(processIteratorResult); + } + return messages.next().then(processIteratorResult); + } + }) + var sendClosure = (data, metadata, buffers, disposeOnDone) => { + return comm_promise.then((comm) => { + comm.send(data, metadata, buffers, disposeOnDone); + }); + }; + var comm = { + send: sendClosure + }; } - window.PyViz.comms[comm_id] = comm; return comm; } - window.PyViz.comm_manager = new JupyterCommManager(); """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.7.4/pyviz_comms.egg-info/PKG-INFO new/pyviz_comms-0.7.6/pyviz_comms.egg-info/PKG-INFO --- old/pyviz_comms-0.7.4/pyviz_comms.egg-info/PKG-INFO 2020-03-10 14:38:06.000000000 +0100 +++ new/pyviz_comms-0.7.6/pyviz_comms.egg-info/PKG-INFO 2020-07-07 13:02:52.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyviz-comms -Version: 0.7.4 +Version: 0.7.6 Summary: Bidirectional communication for the PyViz ecosystem. Home-page: http://pyviz.org Author: PyViz developers @@ -10,12 +10,13 @@ License: BSD Description: # pyviz_comms - Offers a simple bidirectional communication architecture for PyViz tools - including support for Jupyter comms in both the classic notebook and - Jupyterlab. + Offers a simple bidirectional communication architecture between Python and JavaScript, + with support for Jupyter comms in both the classic notebook and Jupyterlab. + Available for use by any [PyViz](https://pyviz.org) tool, but currently primarily used by + [HoloViz](https://holoviz.org) tools. There are two installable components in this repository: a Python - component used by various PyViz tools and an extension to enable + component used by various HoloViz tools and an extension to enable Jupyterlab support. ## Installing the Jupyterlab extension @@ -28,7 +29,7 @@ ## Compatibility - The [PyViz](https://github.com/pyviz/pyviz) libraries are generally version independent of + The [Holoviz](https://github.com/holoviz/holoviz) libraries are generally version independent of [JupyterLab](https://github.com/jupyterlab/jupyterlab) and the ``jupyterlab_pyviz`` extension has been supported since holoviews 1.10.0 and the first release of ``pyviz_comms``. @@ -46,7 +47,7 @@ | 0.34.x | 0.6.1-0.6.2 | | 0.35.x | 0.6.3-0.7.2 | | 1.0.x | 0.8.0 | - | 2.0.x | 0.9.0 | + | 2.0.x | 0.9.0-1.0.3 | ## Developing the Jupyterlab extension @@ -66,7 +67,7 @@ ## The ``pyviz_comms`` Python package - The ``pyviz_comms`` Python package is used by pyviz projects and can be + The ``pyviz_comms`` Python package is used by holoviz projects and can be pip and conda installed. Platform: Windows
