Skip to content

Commit

Permalink
Pin jupyter_client>=6.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Mar 26, 2020
1 parent 5effb39 commit 5514bab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 25 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ def get_data_files():
'install_requires': [
'async_generator',
'jupyter_server>=0.1.0,<0.2.0',
'jupyter_client>=6.0.0',
'nbclient @ git+https://github.com/davidbrochart/nbclient@nest_asyncio',
'jupyter_client>=6.1.1',
'nbclient @ git+https://github.com/jupyter/nbclient',
'nbconvert @ git+https://github.com/jupyter/nbconvert',
'jupyterlab_pygments>=0.1.0,<0.2',
'pygments>=2.4.1,<3' # Explicitly requiring pygments which is a second-order dependency.
Expand Down
2 changes: 1 addition & 1 deletion tests/app/timeout_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def voila_notebook(notebook_directory):

@pytest.fixture
def voila_args_extra():
return ['--VoilaExecutePreprocessor.timeout=1', '--KernelManager.shutdown_wait_time=0.1']
return ['--VoilaExecutor.timeout=1', '--KernelManager.shutdown_wait_time=0.1']


@pytest.mark.gen_test
Expand Down
10 changes: 0 additions & 10 deletions voila/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,6 @@ def _get_timeout(self, cell):

return timeout

# make it nbconvert 5.5 compatible
def _handle_timeout(self, timeout):
self.log.error(
"Timeout waiting for execute reply (%is)." % timeout)
if self.interrupt_on_timeout:
self.log.error("Interrupting kernel")
self.km.interrupt_kernel()
else:
raise TimeoutError("Cell execution timed out")

def run_cell(self, cell, cell_index=0, store_history=False):
parent_msg_id = self.kc.execute(cell.source, store_history=store_history, stop_on_error=not self.allow_errors)
self.log.debug("Executing cell:\n%s", cell.source)
Expand Down
19 changes: 7 additions & 12 deletions voila/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,16 @@ def _jinja_notebook_execute(self, nb, kernel_id):
async def _jinja_cell_generator(self, nb, kernel_id):
"""Generator that will execute a single notebook cell at a time"""
nb, resources = ClearOutputPreprocessor().preprocess(nb, {'metadata': {'path': self.cwd}})
ep = VoilaExecutor(config=self.traitlet_config)

stop_execution = False
with ep.setup_preprocessor(nb, resources, km=km):
for cell_idx, cell in enumerate(nb.cells):
if stop_execution:
break
try:
res = ep.preprocess_cell(cell, resources, cell_idx, store_history=False)
except TimeoutError:
res = (cell, resources)
stop_execution = True

for cell_idx, cell in enumerate(nb.cells):
res = await self.executor.execute_cell(cell, None, cell_idx, store_history=False)
if stop_execution:
break
try:
res = await self.executor.execute_cell(cell, None, cell_idx, store_history=False)
except TimeoutError:
res = cell
stop_execution = True
yield res

# @tornado.gen.coroutine
Expand Down

0 comments on commit 5514bab

Please sign in to comment.