Hello community,

here is the log from the commit of package python-jupyter_sphinx for 
openSUSE:Factory checked in at 2018-08-10 09:48:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jupyter_sphinx (Old)
 and      /work/SRC/openSUSE:Factory/.python-jupyter_sphinx.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-jupyter_sphinx"

Fri Aug 10 09:48:10 2018 rev:2 rq:627201 version:0.1.3

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-jupyter_sphinx/python-jupyter_sphinx.changes  
    2018-06-03 12:36:25.531705885 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-jupyter_sphinx.new/python-jupyter_sphinx.changes
 2018-08-10 09:48:11.378116478 +0200
@@ -1,0 +2,7 @@
+Fri Aug  3 00:31:58 UTC 2018 - toddrme2...@gmail.com
+
+- Update to version 1.3
+  * Pep8 compliancy
+  * Overwrite IPython display earlier in the sphinx build
+
+-------------------------------------------------------------------

Old:
----
  jupyter_sphinx-0.1.2.tar.gz

New:
----
  jupyter_sphinx-0.1.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-jupyter_sphinx.spec ++++++
--- /var/tmp/diff_new_pack.odEtBg/_old  2018-08-10 09:48:11.974117437 +0200
+++ /var/tmp/diff_new_pack.odEtBg/_new  2018-08-10 09:48:11.974117437 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-jupyter_sphinx
-Version:        0.1.2
+Version:        0.1.3
 Release:        0
 Summary:        Jupyter Sphinx Extensions
 License:        BSD-3-Clause

++++++ jupyter_sphinx-0.1.2.tar.gz -> jupyter_sphinx-0.1.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_sphinx-0.1.2/PKG-INFO 
new/jupyter_sphinx-0.1.3/PKG-INFO
--- old/jupyter_sphinx-0.1.2/PKG-INFO   2017-12-06 17:07:05.000000000 +0100
+++ new/jupyter_sphinx-0.1.3/PKG-INFO   2018-07-17 11:06:40.000000000 +0200
@@ -1,11 +1,10 @@
 Metadata-Version: 1.0
 Name: jupyter_sphinx
-Version: 0.1.2
+Version: 0.1.3
 Summary: Jupyter Sphinx Extensions
 Home-page: UNKNOWN
 Author: Jupyter Development Team
 Author-email: jupy...@googlegroups.com
 License: BSD
-Description-Content-Type: UNKNOWN
 Description: UNKNOWN
 Platform: UNKNOWN
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_sphinx-0.1.2/README.md 
new/jupyter_sphinx-0.1.3/README.md
--- old/jupyter_sphinx-0.1.2/README.md  2017-12-05 18:13:40.000000000 +0100
+++ new/jupyter_sphinx-0.1.3/README.md  2018-07-17 10:58:02.000000000 +0200
@@ -1,6 +1,7 @@
 # Jupyter Sphinx Extensions
 
-Jupyter Sphinx extensions enable jupyter-specific features in sphinx.
+Jupyter-sphinx enables the rendering of Jupyter interactive widgets in sphinx
+documentation.
 
 ## Installation
 
@@ -18,8 +19,8 @@
 
 ## Render Jupyter Interactive Widgets `jupyter_sphinx.embed_widgets`
 
-This extension provides a means of inserting live-rendered Jupyter
-interactive widgets within sphinx documentation.
+This extension provides a means of rendering Jupyter interactive widgets within
+sphinx documentation.
 
 It is derived from the [`altair`](https://github.com/altair-viz/altair) sphinx
 extension, which is distributed under the terms of the BSD 3-Clause license.
@@ -44,9 +45,9 @@
 .. ipywidgets-display::
 
     s1, s2 = IntSlider(max=200, value=100), IntSlider(value=40)
-       b = Button(icon='legal')
-       jsdlink((s1, 'value'), (s2, 'max'))
-       VBox([s1, s2, b])
+    b = Button(icon='legal')
+    jsdlink((s1, 'value'), (s2, 'max'))
+    VBox([s1, s2, b])
 ```
 
 In the case of the `ipywidgets-display` code, if the *last statement* of the
@@ -72,21 +73,23 @@
 
 ### Configuration
 
-You conf.py has two extra (optional) configuration options:
+File `conf.py` has two extra (optional) configuration options:
 
- * jupyter_sphinx_require_url: url for `require.js` (if your theme already 
provides this, set it to False or '')
- * jupyter_sphinx_embed_url: url for the embedding, if set to None (default) a 
proper default will be taken from the `ipywidgets.embed` module. 
+ * `jupyter_sphinx_require_url`: url for `require.js` (if your theme already 
provides this, set it to False or '')
+ * `jupyter_sphinx_embed_url`: url for the embedding, if set to None (default) 
a proper default will be taken from the `ipywidgets.embed` module.
 
 ### Misc.
 
 - For the widgets to be succesfuly rendered, this extension requires an
-  internet connection, since it depends on a cdn-distributed JavaScript.
+  internet connection, since it depends on a cdn-served JavaScript file to be
+  loaded.
 - Widgets rendered on the same page use the same widget manager. As a
   consequence, they can be linked with each other via JavaScript link widgets.
   However, no kernel is connect and therefore, interaction with the backend
   will not happen.
 
 ## License
+
 We use a shared copyright model that enables all contributors to maintain the
 copyright on their contributions.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_sphinx-0.1.2/jupyter_sphinx/_version.py 
new/jupyter_sphinx-0.1.3/jupyter_sphinx/_version.py
--- old/jupyter_sphinx-0.1.2/jupyter_sphinx/_version.py 2017-12-06 
16:58:55.000000000 +0100
+++ new/jupyter_sphinx-0.1.3/jupyter_sphinx/_version.py 2018-07-17 
10:58:12.000000000 +0200
@@ -1,2 +1,2 @@
-version_info = (0, 1, 2)
+version_info = (0, 1, 3)
 __version__ = '.'.join(map(str, version_info))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_sphinx-0.1.2/jupyter_sphinx/embed_widgets.py 
new/jupyter_sphinx-0.1.3/jupyter_sphinx/embed_widgets.py
--- old/jupyter_sphinx-0.1.2/jupyter_sphinx/embed_widgets.py    2017-12-05 
18:13:40.000000000 +0100
+++ new/jupyter_sphinx-0.1.3/jupyter_sphinx/embed_widgets.py    2018-07-17 
10:50:41.000000000 +0200
@@ -45,20 +45,25 @@
 import os
 import json
 import warnings
+import sys
+import ast
+import logging
 
 from docutils import nodes
 from docutils.parsers.rst import Directive
 from docutils.parsers.rst.directives import flag, unchanged
 
-from ipywidgets import Widget
-
 from sphinx.locale import _
-from sphinx import addnodes, directives
-from sphinx.util.nodes import set_source_info
 
-import ast
-import logging
+from ipywidgets import Widget
+has_embed = False
+try:
+    import ipywidgets.embed
+    has_embed = True
+except ImportError:
+    pass
 
+_ipython_display_module = sys.modules["IPython.display"]
 logger = logging.getLogger(__name__)
 
 
@@ -112,6 +117,7 @@
 
         return result
 
+
 def purge_widget_setup(app, env, docname):
     if not hasattr(env, 'ipywidgets_setup'):
         return
@@ -130,15 +136,12 @@
 
     def run(self):
         env = self.state.document.settings.env
-        app = env.app
 
         show_code = 'hide-code' not in self.options
         code_below = 'code-below' in self.options
 
-        setupcode =  '\n'.join([
-            'from ipywidgets import Widget',
-            'Widget._ipython_display_ = custom_display'
-        ]) + '\n' + '\n'.join(item['code']
+        setupcode = '\n'.join(
+            item['code']
             for item in getattr(env, 'ipywidgets_setup', [])
             if item['docname'] == env.docname
         )
@@ -152,11 +155,9 @@
         # get the name of the source file we are currently processing
         rst_source = self.state_machine.document['source']
         rst_dir = os.path.dirname(rst_source)
-        rst_filename = os.path.basename(rst_source)
 
         # use the source file name to construct a friendly target_id
         serialno = env.new_serialno('jupyter-widget')
-        rst_base = rst_filename.replace('.', '-')
         target_id = "jupyter-widget-%d" % serialno
         target_node = nodes.target('', '', ids=[target_id])
 
@@ -183,19 +184,45 @@
 
         return result
 
-def make_custom_display(body):
-    def custom_display(self, **kwargs):
-        view_spec = json.dumps(self.get_view_spec())
-        body.append('<script type="application/vnd.jupyter.widget-view+json">' 
+ view_spec + '</script>')
-    return custom_display
+
+def no_display(*objs, **kwargs):
+    pass
+
+_display_function = [no_display]
+
+
+def _current_display(*args, **kwargs):
+    return _display_function[0](*args, **kwargs)
+
+# Overwrite IPython display
+_ipython_display_module.display = _current_display
+sys.modules["IPython.display"] = _ipython_display_module
+
+
+def make_sphinx_display(body):
+    def sphinx_display(*objs, **kwargs):
+        for obj in objs:
+            if isinstance(obj, Widget):
+                view_spec = json.dumps(obj.get_view_spec())
+                body.append('<script 
type="application/vnd.jupyter.widget-view+json">' + view_spec + '</script>')
+
+    return sphinx_display
+
+
+def set_display(disp):
+    _display_function[0] = disp
+
 
 def html_visit_widget(self, node):
     # Execute the setup code, saving the global & local state
-    namespace = dict(custom_display=make_custom_display(self.body))
+    set_display(no_display)
 
+    namespace = dict()
     if node['setupcode']:
         exec(node['setupcode'], namespace)
 
+    set_display(make_sphinx_display(self.body))
+
     # Execute the widget code in this context, evaluating the last line
     try:
         w = exec_then_eval(node['code'], namespace)
@@ -208,8 +235,10 @@
     if isinstance(w, Widget):
         view_spec = json.dumps(w.get_view_spec())
         self.body.append('<script 
type="application/vnd.jupyter.widget-view+json">' + view_spec + '</script>')
+
     raise nodes.SkipNode
 
+
 def generic_visit_widget(self, node):
     if 'alt' in node.attributes:
         self.body.append(_('[ widget: %s ]') % node['alt'])
@@ -217,25 +246,20 @@
         self.body.append(_('[ widget ]'))
     raise nodes.SkipNode
 
+
 def add_widget_state(app, pagename, templatename, context, doctree):
     if 'body' in context and Widget.widgets:
         state_spec = json.dumps(Widget.get_manager_state(drop_defaults=True))
         Widget.widgets = {}
         context['body'] += '<script 
type="application/vnd.jupyter.widget-state+json">' + state_spec + '</script>'
 
-has_embed = False
-try:
-    import ipywidgets.embed
-    has_embed = True
-except ImportError:
-    pass
 
 def builder_inited(app):
     require_url = app.config.jupyter_sphinx_require_url
     # 3 cases
     # case 1: ipywidgets 6, only embed url
     # case 2: ipywidgets 7, with require
-    # case 3: ipywidgets 7, no require 
+    # case 3: ipywidgets 7, no require
     # (ipywidgets6 with require is not supported, require_url is ignored)
     if has_embed:
         if require_url:
@@ -255,12 +279,11 @@
         app.add_javascript(embed_url)
 
 
-
 def setup(app):
     """
     case 1: ipywidgets 6, only embed url
     case 2: ipywidgets 7, with require
-    case 3: ipywidgets 7, no require 
+    case 3: ipywidgets 7, no require
     """
     setup.app = app
     setup.config = app.config
@@ -271,7 +294,6 @@
     app.add_config_value('jupyter_sphinx_require_url', require_url_default, 
'html')
     app.add_config_value('jupyter_sphinx_embed_url', None, 'html')
 
-
     app.add_node(widget,
                  html=(html_visit_widget, None),
                  latex=(generic_visit_widget, None),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jupyter_sphinx-0.1.2/jupyter_sphinx.egg-info/PKG-INFO 
new/jupyter_sphinx-0.1.3/jupyter_sphinx.egg-info/PKG-INFO
--- old/jupyter_sphinx-0.1.2/jupyter_sphinx.egg-info/PKG-INFO   2017-12-06 
17:07:05.000000000 +0100
+++ new/jupyter_sphinx-0.1.3/jupyter_sphinx.egg-info/PKG-INFO   2018-07-17 
11:06:40.000000000 +0200
@@ -1,11 +1,10 @@
 Metadata-Version: 1.0
 Name: jupyter-sphinx
-Version: 0.1.2
+Version: 0.1.3
 Summary: Jupyter Sphinx Extensions
 Home-page: UNKNOWN
 Author: Jupyter Development Team
 Author-email: jupy...@googlegroups.com
 License: BSD
-Description-Content-Type: UNKNOWN
 Description: UNKNOWN
 Platform: UNKNOWN
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jupyter_sphinx-0.1.2/jupyter_sphinx.egg-info/SOURCES.txt 
new/jupyter_sphinx-0.1.3/jupyter_sphinx.egg-info/SOURCES.txt
--- old/jupyter_sphinx-0.1.2/jupyter_sphinx.egg-info/SOURCES.txt        
2017-12-06 17:07:05.000000000 +0100
+++ new/jupyter_sphinx-0.1.3/jupyter_sphinx.egg-info/SOURCES.txt        
2018-07-17 11:06:40.000000000 +0200
@@ -1,6 +1,7 @@
 LICENSE
 MANIFEST.in
 README.md
+setup.cfg
 setup.py
 jupyter_sphinx/__init__.py
 jupyter_sphinx/_version.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_sphinx-0.1.2/setup.cfg 
new/jupyter_sphinx-0.1.3/setup.cfg
--- old/jupyter_sphinx-0.1.2/setup.cfg  2017-12-06 17:07:05.000000000 +0100
+++ new/jupyter_sphinx-0.1.3/setup.cfg  2018-07-17 11:06:40.000000000 +0200
@@ -1,3 +1,6 @@
+[metadata]
+license_file = LICENSE
+
 [egg_info]
 tag_build = 
 tag_date = 0


Reply via email to