Skip to content

Commit 78740a5

Browse files
committed
allowing jupyter_sphinx.execute to continue working
1 parent 132931f commit 78740a5

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

jupyter_sphinx/__init__.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ def build_finished(app, env):
6060
copy_asset(src, dst)
6161

6262

63-
def setup(app):
63+
def _setup(app):
64+
"""A temporary setup function so that we can use it here and in execute.
65+
66+
This should be removed and converted into `setup` after a deprecation
67+
cycle.
68+
"""
6469
# Configuration
6570

6671
app.add_config_value(
@@ -233,3 +238,12 @@ def visit_thebe_source(self, node):
233238
'version': __version__,
234239
'parallel_read_safe': True,
235240
}
241+
242+
243+
def setup(app):
244+
"""The main setup function.
245+
246+
This should be replaced with `_setup` after a deprecation cycle.
247+
"""
248+
out = _setup(app)
249+
return out

jupyter_sphinx/execute.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,18 @@ def write_notebook_output(notebook, output_dir, notebook_name):
248248
def contains_widgets(notebook):
249249
widgets = get_widgets(notebook)
250250
return widgets and widgets['state']
251+
252+
253+
def setup(app):
254+
"""A temporary setup function so that we can use it for
255+
backwards compatability.
256+
257+
This should be removed after a deprecation cycle.
258+
"""
259+
js.logger.warning(("`jupyter-sphinx` was initialized with the "
260+
"`jupyter_sphinx.execute` sub-module. Replace this with "
261+
"`jupyter_sphinx`. Initializing with "
262+
"`jupyter_sphinx.execute` will be removed in "
263+
"version 0.3"))
264+
out = js._setup(app)
265+
return out

0 commit comments

Comments
 (0)