Hello community, here is the log from the commit of package python-pyviz-comms for openSUSE:Factory checked in at 2019-01-21 10:45:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyviz-comms (Old) and /work/SRC/openSUSE:Factory/.python-pyviz-comms.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyviz-comms" Mon Jan 21 10:45:55 2019 rev:2 rq:662844 version:0.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyviz-comms/python-pyviz-comms.changes 2018-10-12 13:11:24.919238249 +0200 +++ /work/SRC/openSUSE:Factory/.python-pyviz-comms.new.28833/python-pyviz-comms.changes 2019-01-21 10:45:57.784341807 +0100 @@ -1,0 +2,11 @@ +Fri Jan 4 16:07:58 UTC 2019 - Todd R <[email protected]> + +- Update to version 0.7.0 + * Send ACK and error messages as metadata + * Small fix to handling notebook output + * Add warning about installing extension in JupyterLab + * Add a pyviz_extension baseclass for other projects + * Guard against PyViz not being defined + * Updated JLab and classic notebook extensions + +------------------------------------------------------------------- Old: ---- pyviz_comms-0.6.0.tar.gz New: ---- python-pyviz-comms-rpmlintrc pyviz_comms-0.7.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyviz-comms.spec ++++++ --- /var/tmp/diff_new_pack.tLW7Sz/_old 2019-01-21 10:46:00.088338972 +0100 +++ /var/tmp/diff_new_pack.tLW7Sz/_new 2019-01-21 10:46:00.092338966 +0100 @@ -17,13 +17,14 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pyviz-comms -Version: 0.6.0 +Version: 0.7.0 Release: 0 License: BSD-3-Clause Summary: Tool to launch jobs, organize the output, and dissect the results -Url: http://pyviz.org +Url: https://github.com/pyviz/pyviz_comms Group: Development/Languages/Python -Source: 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 ++++++ python-pyviz-comms-rpmlintrc ++++++ addFilter("hidden-file-or-dir .*/pyviz_comms/.version") ++++++ pyviz_comms-0.6.0.tar.gz -> pyviz_comms-0.7.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.6.0/PKG-INFO new/pyviz_comms-0.7.0/PKG-INFO --- old/pyviz_comms-0.6.0/PKG-INFO 2018-09-03 17:43:09.000000000 +0200 +++ new/pyviz_comms-0.7.0/PKG-INFO 2018-12-24 20:03:56.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyviz_comms -Version: 0.6.0 +Version: 0.7.0 Summary: Launch jobs, organize the output, and dissect the results. Home-page: http://pyviz.org Author: PyViz developers @@ -26,6 +26,26 @@ jupyter labextension install @pyviz/jupyterlab_pyviz ``` + ## Compatibility + + The [PyViz](https://github.com/pyviz/pyviz) 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``. + + Our goal is that ``jupyterlab_pyviz`` minor releases (using the [SemVer](https://semver.org/) pattern) are + made to follow JupyterLab minor release bumps and micro releases are for new ``jupyterlab_pyviz`` features + or bug fix releases. We've been previously inconsistent with having the extension release minor version bumps + 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 + + | JupyterLab | jupyterlab_pyviz | + | ------------- | ---------------- | + | 0.33.x | 0.6.0 | + | 0.34.x | 0.6.1 | + | 0.35.x | 0.6.3 | + ## Developing the Jupyterlab extension For a development install (requires npm version 4 or later), do the following in the repository directory: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.6.0/README.md new/pyviz_comms-0.7.0/README.md --- old/pyviz_comms-0.6.0/README.md 2018-09-03 17:19:39.000000000 +0200 +++ new/pyviz_comms-0.7.0/README.md 2018-12-24 19:56:32.000000000 +0100 @@ -16,6 +16,26 @@ jupyter labextension install @pyviz/jupyterlab_pyviz ``` +## Compatibility + +The [PyViz](https://github.com/pyviz/pyviz) 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``. + +Our goal is that ``jupyterlab_pyviz`` minor releases (using the [SemVer](https://semver.org/) pattern) are +made to follow JupyterLab minor release bumps and micro releases are for new ``jupyterlab_pyviz`` features +or bug fix releases. We've been previously inconsistent with having the extension release minor version bumps +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 + +| JupyterLab | jupyterlab_pyviz | +| ------------- | ---------------- | +| 0.33.x | 0.6.0 | +| 0.34.x | 0.6.1 | +| 0.35.x | 0.6.3 | + ## Developing the Jupyterlab extension For a development install (requires npm version 4 or later), do the following in the repository directory: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.6.0/pyviz_comms/.version new/pyviz_comms-0.7.0/pyviz_comms/.version --- old/pyviz_comms-0.6.0/pyviz_comms/.version 2018-09-03 17:43:09.000000000 +0200 +++ new/pyviz_comms-0.7.0/pyviz_comms/.version 2018-12-24 20:03:56.000000000 +0100 @@ -1 +1 @@ -{"git_describe": "v0.6.0-0-g95e416e", "version_string": "0.6.0"} \ No newline at end of file +{"git_describe": "v0.7.0-0-g3c101fc", "version_string": "0.7.0"} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.6.0/pyviz_comms/__init__.py new/pyviz_comms-0.7.0/pyviz_comms/__init__.py --- old/pyviz_comms-0.6.0/pyviz_comms/__init__.py 2018-09-03 17:19:39.000000000 +0200 +++ new/pyviz_comms-0.7.0/pyviz_comms/__init__.py 2018-12-24 19:56:32.000000000 +0100 @@ -4,6 +4,7 @@ import uuid import traceback + try: from StringIO import StringIO except: @@ -21,6 +22,33 @@ nb_mime_js = '\n\n' + f.read() + +class extension(param.ParameterizedFunction): + """ + Base class for pyviz extensions, which allow defining shared cleanup + utilities. + """ + + # A registry of actions to perform when a delete event is received + _delete_actions = [] + + @classmethod + def add_delete_action(cls, action): + cls._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']) + + PYVIZ_PROXY = """ if (window.PyViz === undefined) { if (window.HoloViews === undefined) { @@ -52,14 +80,14 @@ window.PyViz.receivers[plot_id] = receiver; }} -if (buffers.length > 0) {{ +if ((buffers != undefined) && (buffers.length > 0)) {{ receiver.consume(buffers[0].buffer) }} else {{ receiver.consume(msg) }} const comm_msg = receiver.message; -if (comm_msg != null) {{ +if ((comm_msg != null) && (Object.keys(comm_msg.content).length > 0)) {{ plot.model.document.apply_json_patch(comm_msg.content, comm_msg.buffers) }} """ @@ -72,7 +100,11 @@ htmlObject.innerHTML = `{html}`; var scriptTags = document.getElementsByTagName('script'); var parentTag = scriptTags[scriptTags.length-1].parentNode; - parentTag.append(htmlObject) + if (parentTag.attributes.length && (parentTag.attributes[0].name == 'data-shell-mode')) {{ + alert('Displaying PyViz objects in JupyterLab requires the jupyterlab_pyviz extension to be installed, install it with:\\n\\n\\tjupyter labextension install @pyviz/jupyterlab_pyviz'); + }} else {{ + parentTag.append(htmlObject) + }} }} """ @@ -108,8 +140,8 @@ function on_msg(msg) {{ // Receives acknowledgement from Python, processing event // and unblocking Comm if event queue empty - msg = JSON.parse(msg.content.data); - var comm_id = msg["comm_id"] + var metadata = msg.metadata; + var comm_id = metadata.comm_id var comm_status = window.PyViz.comm_status[comm_id]; if (comm_status.event_buffer.length) {{ process_events(comm_status); @@ -119,15 +151,15 @@ comm_status.blocked = false; }} comm_status.event_buffer = []; - if ((msg.msg_type == "Ready") && msg.content) {{ - console.log("Python callback returned following output:", msg.content); - }} else if (msg.msg_type == "Error") {{ - console.log("Python failed with the following traceback:", msg['traceback']) + if ((metadata.msg_type == "Ready") && metadata.content) {{ + console.log("Python callback returned following output:", metadata.content); + }} else if (metadata.msg_type == "Error") {{ + console.log("Python failed with the following traceback:", metadata.traceback) }} }} // Initialize Comm -if (window.PyViz.comm_manager == undefined) {{ return }} +if ((window.PyViz == undefined) || (window.PyViz.comm_manager == undefined)) {{ return }} comm = window.PyViz.comm_manager.get_client_comm("{plot_id}", "{comm_id}", on_msg); if (!comm) {{ return @@ -226,7 +258,7 @@ """ - def send(self, data=None, buffers=[]): + def send(self, data=None, metadata=None, buffers=[]): """ Sends data to the frontend """ @@ -282,7 +314,7 @@ # the correct comms handle is unblocked if comm_id: reply['comm_id'] = comm_id - self.send(json.dumps(reply)) + self.send(metadata=reply) class JupyterComm(Comm): @@ -293,11 +325,24 @@ js_template = """ function msg_handler(msg) {{ + var metadata = msg.metadata; var buffers = msg.buffers; var msg = msg.content.data; - {msg_handler} + if ((metadata.msg_type == "Ready")) {{ + if (metadata.content) {{ + console.log("Python callback returned following output:", metadata.content); + }} + }} else if (metadata.msg_type == "Error") {{ + console.log("Python failed with the following traceback:", metadata.traceback) + }} else {{ + {msg_handler} + }} + }} + if ((window.PyViz == undefined) || (!window.PyViz.comm_manager)) {{ + console.log("Could not find comm manager") + }} else {{ + window.PyViz.comm_manager.register_target('{plot_id}', '{comm_id}', msg_handler); }} - window.PyViz.comm_manager.register_target('{plot_id}', '{comm_id}', msg_handler); """ def init(self): @@ -325,13 +370,13 @@ self._comm.close() - def send(self, data=None, buffers=[]): + def send(self, data=None, metadata=None, buffers=[]): """ Pushes data across comm socket. """ if not self._comm: self.init() - self.comm.send(data, buffers=buffers) + self.comm.send(data, metadata=metadata, buffers=buffers) @@ -382,11 +427,11 @@ self._comm.on_msg(self._handle_msg) - def send(self, data=None, buffers=[]): + def send(self, data=None, metadata=None, buffers=[]): """ Pushes data across comm socket. """ - self.comm.send(data, buffers=buffers) + self.comm.send(data, metadata=metadata, buffers=buffers) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.6.0/pyviz_comms/notebook.js new/pyviz_comms-0.7.0/pyviz_comms/notebook.js --- old/pyviz_comms-0.6.0/pyviz_comms/notebook.js 2018-09-03 17:19:39.000000000 +0200 +++ new/pyviz_comms-0.7.0/pyviz_comms/notebook.js 2018-12-24 19:56:32.000000000 +0100 @@ -19,7 +19,7 @@ function handle_add_output(event, handle) { var output_area = handle.output_area; var output = handle.output; - if (!output.data.hasOwnProperty(EXEC_MIME_TYPE)) { + if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) { return } var id = output.metadata[EXEC_MIME_TYPE]["id"]; @@ -30,9 +30,9 @@ 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)) { - PyViz.plot_index[id] = Bokeh.index[id]; + window.PyViz.plot_index[id] = Bokeh.index[id]; } else { - PyViz.plot_index[id] = null; + window.PyViz.plot_index[id] = null; } } } @@ -49,8 +49,12 @@ } delete PyViz.plot_index[id]; if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) { - window.Bokeh.index[id].model.document.clear(); - delete Bokeh.index[id]; + var doc = window.Bokeh.index[id].model.document + doc.clear(); + const i = window.Bokeh.documents.indexOf(doc); + if (i > -1) { + window.Bokeh.documents.splice(i, 1); + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyviz_comms-0.6.0/pyviz_comms.egg-info/PKG-INFO new/pyviz_comms-0.7.0/pyviz_comms.egg-info/PKG-INFO --- old/pyviz_comms-0.6.0/pyviz_comms.egg-info/PKG-INFO 2018-09-03 17:43:09.000000000 +0200 +++ new/pyviz_comms-0.7.0/pyviz_comms.egg-info/PKG-INFO 2018-12-24 20:03:56.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyviz-comms -Version: 0.6.0 +Version: 0.7.0 Summary: Launch jobs, organize the output, and dissect the results. Home-page: http://pyviz.org Author: PyViz developers @@ -26,6 +26,26 @@ jupyter labextension install @pyviz/jupyterlab_pyviz ``` + ## Compatibility + + The [PyViz](https://github.com/pyviz/pyviz) 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``. + + Our goal is that ``jupyterlab_pyviz`` minor releases (using the [SemVer](https://semver.org/) pattern) are + made to follow JupyterLab minor release bumps and micro releases are for new ``jupyterlab_pyviz`` features + or bug fix releases. We've been previously inconsistent with having the extension release minor version bumps + 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 + + | JupyterLab | jupyterlab_pyviz | + | ------------- | ---------------- | + | 0.33.x | 0.6.0 | + | 0.34.x | 0.6.1 | + | 0.35.x | 0.6.3 | + ## Developing the Jupyterlab extension For a development install (requires npm version 4 or later), do the following in the repository directory:
