Hello community,
here is the log from the commit of package python-pyviz-comms for
openSUSE:Leap:15.2 checked in at 2020-03-02 13:21:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-pyviz-comms (Old)
and /work/SRC/openSUSE:Leap:15.2/.python-pyviz-comms.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyviz-comms"
Mon Mar 2 13:21:53 2020 rev:4 rq:777068 version:0.7.3
Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-pyviz-comms/python-pyviz-comms.changes
2020-01-15 15:52:29.707565293 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.python-pyviz-comms.new.26092/python-pyviz-comms.changes
2020-03-02 13:21:53.918224341 +0100
@@ -1,0 +2,12 @@
+Thu Jan 30 15:25:12 UTC 2020 - Todd R <[email protected]>
+
+- Update to 0.7.3
+ * Add ability to register on_error and on_stdout handlers on Comms.
+
+-------------------------------------------------------------------
+Mon Apr 22 19:21:30 UTC 2019 - Todd R <[email protected]>
+
+- Update to version 0.7.2
+ * Custom MIME type rendering now executes script tags in HTML
+
+-------------------------------------------------------------------
Old:
----
pyviz_comms-0.7.0.tar.gz
New:
----
pyviz_comms-0.7.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pyviz-comms.spec ++++++
--- /var/tmp/diff_new_pack.7ozDEV/_old 2020-03-02 13:21:55.006226505 +0100
+++ /var/tmp/diff_new_pack.7ozDEV/_new 2020-03-02 13:21:55.006226505 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-pyviz-comms
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,17 +12,18 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
+#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pyviz-comms
-Version: 0.7.0
+Version: 0.7.3
Release: 0
-License: BSD-3-Clause
Summary: Tool to launch jobs, organize the output, and dissect the
results
-Url: https://github.com/pyviz/pyviz_comms
+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
Source100: python-pyviz-comms-rpmlintrc
BuildRequires: %{python_module setuptools}
++++++ pyviz_comms-0.7.0.tar.gz -> pyviz_comms-0.7.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/MANIFEST.in
new/pyviz_comms-0.7.3/MANIFEST.in
--- old/pyviz_comms-0.7.0/MANIFEST.in 2018-12-24 19:56:32.000000000 +0100
+++ new/pyviz_comms-0.7.3/MANIFEST.in 2020-01-22 02:41:51.000000000 +0100
@@ -1,3 +1,4 @@
include README.md
include LICENSE.txt
-include pyviz_comms/.version
\ No newline at end of file
+include pyviz_comms/.version
+include pyviz_comms/notebook.js
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/PKG-INFO
new/pyviz_comms-0.7.3/PKG-INFO
--- old/pyviz_comms-0.7.0/PKG-INFO 2018-12-24 20:03:56.000000000 +0100
+++ new/pyviz_comms-0.7.3/PKG-INFO 2020-01-22 02:42:51.000000000 +0100
@@ -1,12 +1,12 @@
Metadata-Version: 2.1
Name: pyviz_comms
-Version: 0.7.0
-Summary: Launch jobs, organize the output, and dissect the results.
+Version: 0.7.3
+Summary: Bidirectional communication for the PyViz ecosystem.
Home-page: http://pyviz.org
Author: PyViz developers
Author-email:
Maintainer: PyViz
-Maintainer-email: [email protected]
+Maintainer-email: [email protected]
License: BSD
Description: # pyviz_comms
@@ -38,13 +38,14 @@
track that of JupyterLab, so users seeking to find extension releases
that are compatible with their JupyterLab
installation may refer to the below table.
- ###### Compatible JupyterLab and jupyterlab_bokeh versions
+ ###### Compatible JupyterLab and jupyterlab_pyviz versions
| JupyterLab | jupyterlab_pyviz |
| ------------- | ---------------- |
| 0.33.x | 0.6.0 |
- | 0.34.x | 0.6.1 |
- | 0.35.x | 0.6.3 |
+ | 0.34.x | 0.6.1-0.6.2 |
+ | 0.35.x | 0.6.3-0.7.2 |
+ | 1.0.x | 0.8.0 |
## Developing the Jupyterlab extension
@@ -82,3 +83,6 @@
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
+Provides-Extra: tests
+Provides-Extra: build
+Provides-Extra: all
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/README.md
new/pyviz_comms-0.7.3/README.md
--- old/pyviz_comms-0.7.0/README.md 2018-12-24 19:56:32.000000000 +0100
+++ new/pyviz_comms-0.7.3/README.md 2020-01-22 02:41:51.000000000 +0100
@@ -28,13 +28,14 @@
track that of JupyterLab, so users seeking to find extension releases that are
compatible with their JupyterLab
installation may refer to the below table.
-###### Compatible JupyterLab and jupyterlab_bokeh versions
+###### Compatible JupyterLab and jupyterlab_pyviz versions
| JupyterLab | jupyterlab_pyviz |
| ------------- | ---------------- |
| 0.33.x | 0.6.0 |
-| 0.34.x | 0.6.1 |
-| 0.35.x | 0.6.3 |
+| 0.34.x | 0.6.1-0.6.2 |
+| 0.35.x | 0.6.3-0.7.2 |
+| 1.0.x | 0.8.0 |
## Developing the Jupyterlab extension
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/pyproject.toml
new/pyviz_comms-0.7.3/pyproject.toml
--- old/pyviz_comms-0.7.0/pyproject.toml 1970-01-01 01:00:00.000000000
+0100
+++ new/pyviz_comms-0.7.3/pyproject.toml 2020-01-22 02:41:51.000000000
+0100
@@ -0,0 +1,6 @@
+[build-system]
+requires = [
+ "param >=1.7.0",
+ "pyct >=0.4.4",
+ "setuptools >=30.3.0"
+]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/pyviz_comms/.version
new/pyviz_comms-0.7.3/pyviz_comms/.version
--- old/pyviz_comms-0.7.0/pyviz_comms/.version 2018-12-24 20:03:56.000000000
+0100
+++ new/pyviz_comms-0.7.3/pyviz_comms/.version 2020-01-22 02:42:51.000000000
+0100
@@ -1 +1 @@
-{"git_describe": "v0.7.0-0-g3c101fc", "version_string": "0.7.0"}
\ No newline at end of file
+{"git_describe": "v0.7.3-0-g4aaed63", "version_string": "0.7.3"}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/pyviz_comms/__init__.py
new/pyviz_comms-0.7.3/pyviz_comms/__init__.py
--- old/pyviz_comms-0.7.0/pyviz_comms/__init__.py 2018-12-24
19:56:32.000000000 +0100
+++ new/pyviz_comms-0.7.3/pyviz_comms/__init__.py 2020-01-22
02:41:51.000000000 +0100
@@ -1,10 +1,8 @@
import os
import sys
-import json
import uuid
import traceback
-
try:
from StringIO import StringIO
except:
@@ -32,26 +30,35 @@
# A registry of actions to perform when a delete event is received
_delete_actions = []
+ # A registry of actions to perform when a server delete event is received
+ _server_delete_actions = []
+
@classmethod
def add_delete_action(cls, action):
cls._delete_actions.append(action)
@classmethod
+ def add_server_delete_action(cls, action):
+ cls._server_delete_actions.append(action)
+
+ @classmethod
def _process_comm_msg(cls, msg):
"""
Processes comm messages to handle global actions such as
cleaning up plots.
"""
- if msg['event_type'] != 'delete':
- return
-
- for action in cls._delete_actions:
- action(msg['id'])
+ event_type = msg['event_type']
+ if event_type == 'delete':
+ for action in cls._delete_actions:
+ action(msg['id'])
+ elif event_type == 'server_delete':
+ for action in cls._server_delete_actions:
+ action(msg['id'])
PYVIZ_PROXY = """
-if (window.PyViz === undefined) {
- if (window.HoloViews === undefined) {
+if ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {
+ if ((window.HoloViews === undefined) || (window.HoloViews instanceof
HTMLElement)) {
var PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {},
plot_index: []}
} else {
var PyViz = window.HoloViews;
@@ -61,20 +68,49 @@
}
"""
+ABORT_JS = """
+if (!window.PyViz) {{
+ return;
+}}
+var events = [];
+var receiver = window.PyViz.receivers['{plot_id}'];
+if (receiver &&
+ receiver._partial &&
+ receiver._partial.content &&
+ receiver._partial.content.events) {{
+ events = receiver._partial.content.events;
+}}
+
+var value = cb_obj['{change}'];
+
+{transform}
+
+for (var event of events) {{
+ if ((event.kind === 'ModelChanged') && (event.attr === '{change}') &&
+ (cb_obj.id === event.model.id) &&
+ (JSON.stringify(value) === JSON.stringify(event.new))) {{
+ events.pop(events.indexOf(event))
+ return;
+ }}
+}}
+"""
# Following JS block becomes body of the message handler callback
bokeh_msg_handler = """
var plot_id = "{plot_id}";
-if (plot_id in window.PyViz.plot_index) {{
+
+if ((plot_id in window.PyViz.plot_index) && (window.PyViz.plot_index[plot_id]
!= null)) {{
var plot = window.PyViz.plot_index[plot_id];
-}} else {{
+}} else if ((Bokeh !== undefined) && (plot_id in Bokeh.index)) {{
var plot = Bokeh.index[plot_id];
}}
+if (plot == null) {{
+ return
+}}
+
if (plot_id in window.PyViz.receivers) {{
var receiver = window.PyViz.receivers[plot_id];
-}} else if (Bokeh.protocol === undefined) {{
- return;
}} else {{
var receiver = new Bokeh.protocol.Receiver();
window.PyViz.receivers[plot_id] = receiver;
@@ -173,7 +209,11 @@
}}
// Add current event to queue and process queue if not blocked
-event_name = cb_obj.event_name
+var event_name = cb_obj.event_name;
+if (event_name === undefined) {{
+ // we are a widget not an event... fake a key.
+ event_name = Object.keys(data).join(',');
+}}
data['comm_id'] = "{comm_id}";
timeout = comm_status.time + {timeout};
if ((comm_status.blocked && (Date.now() < timeout))) {{
@@ -237,11 +277,13 @@
js_template = ''
- def __init__(self, id=None, on_msg=None):
+ def __init__(self, id=None, on_msg=None, on_error=None, on_stdout=None):
"""
Initializes a Comms object
"""
self._on_msg = on_msg
+ self._on_error = on_error
+ self._on_stdout = on_stdout
self._comm = None
super(Comm, self).__init__(id = id if id else uuid.uuid4().hex)
@@ -294,7 +336,16 @@
# it and then send it to the frontend
with StandardOutput() as stdout:
self._on_msg(msg)
+ if stdout:
+ try:
+ self._on_stdout(stdout)
+ except:
+ pass
except Exception as e:
+ try:
+ self._on_error(e)
+ except:
+ pass
error = '\n'
frames = traceback.extract_tb(sys.exc_info()[2])
for frame in frames[-10:]:
@@ -399,12 +450,12 @@
</script>
"""
- def __init__(self, id=None, on_msg=None):
+ def __init__(self, id=None, on_msg=None, on_error=None, on_stdout=None):
"""
Initializes a Comms object
"""
from IPython import get_ipython
- super(JupyterCommJS, self).__init__(id, on_msg)
+ super(JupyterCommJS, self).__init__(id, on_msg, on_error, on_stdout)
self.manager = get_ipython().kernel.comm_manager
self.manager.register_target(self.id, self._handle_open)
@@ -461,14 +512,14 @@
client_comm = Comm
@classmethod
- def get_server_comm(cls, on_msg=None, id=None):
- comm = cls.server_comm(id, on_msg)
+ 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)
cls._comms[comm.id] = comm
return comm
@classmethod
- def get_client_comm(cls, on_msg=None, id=None):
- comm = cls.client_comm(id, on_msg)
+ 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)
cls._comms[comm.id] = comm
return comm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/pyviz_comms/notebook.js
new/pyviz_comms-0.7.3/pyviz_comms/notebook.js
--- old/pyviz_comms-0.7.0/pyviz_comms/notebook.js 2018-12-24
19:56:32.000000000 +0100
+++ new/pyviz_comms-0.7.3/pyviz_comms/notebook.js 2020-01-22
02:41:51.000000000 +0100
@@ -26,14 +26,47 @@
var toinsert = output_area.element.find("." + CLASS_NAME.split(' ')[0]);
if (id !== undefined) {
var nchildren = toinsert.length;
- toinsert[nchildren-1].children[0].innerHTML = output.data[HTML_MIME_TYPE];
- toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];
+ var html_node = toinsert[nchildren-1].children[0];
+ html_node.innerHTML = output.data[HTML_MIME_TYPE];
+ var scripts = [];
+ var nodelist = html_node.querySelectorAll("script");
+ for (var i in nodelist) {
+ if (nodelist.hasOwnProperty(i)) {
+ scripts.push(nodelist[i])
+ }
+ }
+
+ scripts.forEach( function (oldScript) {
+ var newScript = document.createElement("script");
+ var attrs = [];
+ var nodemap = oldScript.attributes;
+ for (var j in nodemap) {
+ if (nodemap.hasOwnProperty(j)) {
+ attrs.push(nodemap[j])
+ }
+ }
+ attrs.forEach(function(attr) { newScript.setAttribute(attr.name,
attr.value) });
+ newScript.appendChild(document.createTextNode(oldScript.innerHTML));
+ oldScript.parentNode.replaceChild(newScript, oldScript);
+ });
+ if (JS_MIME_TYPE in output.data) {
+ toinsert[nchildren-1].children[1].textContent =
output.data[JS_MIME_TYPE];
+ }
output_area._hv_plot_id = id;
if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {
window.PyViz.plot_index[id] = Bokeh.index[id];
} else {
window.PyViz.plot_index[id] = null;
}
+ } else if (output.metadata[EXEC_MIME_TYPE]["server_id"] !== undefined) {
+ var bk_div = document.createElement("div");
+ bk_div.innerHTML = output.data[HTML_MIME_TYPE];
+ var script_attrs = bk_div.children[0].attributes;
+ for (var i = 0; i < script_attrs.length; i++) {
+ toinsert[toinsert.length -
1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);
+ }
+ // store reference to server id on output_area
+ output_area._bokeh_server_id =
output.metadata[EXEC_MIME_TYPE]["server_id"];
}
}
@@ -42,9 +75,13 @@
*/
function handle_clear_output(event, handle) {
var id = handle.cell.output_area._hv_plot_id;
- if ((id === undefined) || !(id in PyViz.plot_index)) { return; }
+ var server_id = handle.cell.output_area._bokeh_server_id;
+ if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !==
undefined)) { return; }
var comm = window.PyViz.comm_manager.get_client_comm("hv-extension-comm",
"hv-extension-comm", function () {});
- if (comm !== null) {
+ if (server_id !== null) {
+ comm.send({event_type: 'server_delete', 'id': server_id});
+ return;
+ } else if (comm !== null) {
comm.send({event_type: 'delete', 'id': id});
}
delete PyViz.plot_index[id];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/pyviz_comms.egg-info/PKG-INFO
new/pyviz_comms-0.7.3/pyviz_comms.egg-info/PKG-INFO
--- old/pyviz_comms-0.7.0/pyviz_comms.egg-info/PKG-INFO 2018-12-24
20:03:56.000000000 +0100
+++ new/pyviz_comms-0.7.3/pyviz_comms.egg-info/PKG-INFO 2020-01-22
02:42:51.000000000 +0100
@@ -1,12 +1,12 @@
Metadata-Version: 2.1
Name: pyviz-comms
-Version: 0.7.0
-Summary: Launch jobs, organize the output, and dissect the results.
+Version: 0.7.3
+Summary: Bidirectional communication for the PyViz ecosystem.
Home-page: http://pyviz.org
Author: PyViz developers
Author-email:
Maintainer: PyViz
-Maintainer-email: [email protected]
+Maintainer-email: [email protected]
License: BSD
Description: # pyviz_comms
@@ -38,13 +38,14 @@
track that of JupyterLab, so users seeking to find extension releases
that are compatible with their JupyterLab
installation may refer to the below table.
- ###### Compatible JupyterLab and jupyterlab_bokeh versions
+ ###### Compatible JupyterLab and jupyterlab_pyviz versions
| JupyterLab | jupyterlab_pyviz |
| ------------- | ---------------- |
| 0.33.x | 0.6.0 |
- | 0.34.x | 0.6.1 |
- | 0.35.x | 0.6.3 |
+ | 0.34.x | 0.6.1-0.6.2 |
+ | 0.35.x | 0.6.3-0.7.2 |
+ | 1.0.x | 0.8.0 |
## Developing the Jupyterlab extension
@@ -82,3 +83,6 @@
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
+Provides-Extra: tests
+Provides-Extra: build
+Provides-Extra: all
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/pyviz_comms.egg-info/SOURCES.txt
new/pyviz_comms-0.7.3/pyviz_comms.egg-info/SOURCES.txt
--- old/pyviz_comms-0.7.0/pyviz_comms.egg-info/SOURCES.txt 2018-12-24
20:03:56.000000000 +0100
+++ new/pyviz_comms-0.7.3/pyviz_comms.egg-info/SOURCES.txt 2020-01-22
02:42:51.000000000 +0100
@@ -1,6 +1,7 @@
LICENSE.txt
MANIFEST.in
README.md
+pyproject.toml
setup.py
pyviz_comms/.version
pyviz_comms/__init__.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/pyviz_comms.egg-info/requires.txt
new/pyviz_comms-0.7.3/pyviz_comms.egg-info/requires.txt
--- old/pyviz_comms-0.7.0/pyviz_comms.egg-info/requires.txt 2018-12-24
20:03:56.000000000 +0100
+++ new/pyviz_comms-0.7.3/pyviz_comms.egg-info/requires.txt 2020-01-22
02:42:51.000000000 +0100
@@ -1 +1,15 @@
param
+
+[all]
+flake8
+nose
+param>=1.7.0
+setuptools
+
+[build]
+param>=1.7.0
+setuptools
+
+[tests]
+flake8
+nose
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyviz_comms-0.7.0/setup.py
new/pyviz_comms-0.7.3/setup.py
--- old/pyviz_comms-0.7.0/setup.py 2018-12-24 19:56:32.000000000 +0100
+++ new/pyviz_comms-0.7.3/setup.py 2020-01-22 02:41:51.000000000 +0100
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-import sys, os
+import os
try:
from setuptools import setup
except ImportError:
@@ -26,24 +26,32 @@
return json.load(open(version_file_path, 'r'))['version_string']
+extras_require = {
+ 'tests': ['flake8', 'nose'], # nose required due to pip_on_conda
+ 'build': ['param >=1.7.0', 'setuptools']
+}
+
+extras_require['all'] = sorted(set(sum(extras_require.values(), [])))
+
install_requires = ['param']
-setup_args = {}
-setup_args.update(dict(
+setup_args = dict(
name='pyviz_comms',
version=get_setup_version("pyviz_comms"),
install_requires = install_requires,
- description='Launch jobs, organize the output, and dissect the results.',
+ extras_require=extras_require,
+ tests_require=extras_require['tests'],
+ description='Bidirectional communication for the PyViz ecosystem.',
long_description=open('README.md').read() if os.path.isfile('README.md')
else 'Consult README.md',
long_description_content_type="text/markdown",
author= "PyViz developers",
author_email= "",
maintainer= "PyViz",
- maintainer_email= "[email protected]",
+ maintainer_email= "[email protected]",
platforms=['Windows', 'Mac OS X', 'Linux'],
license='BSD',
url='http://pyviz.org',
packages = ["pyviz_comms"],
- package_data={'pyviz_comms': ['.version', 'notebook.js']},
+ include_package_data=True,
classifiers = [
"License :: OSI Approved :: BSD License",
"Development Status :: 5 - Production/Stable",
@@ -56,7 +64,7 @@
"Natural Language :: English",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries"]
-))
+)
if __name__=="__main__":