diff --git a/nbgrader/preprocessors/execute.py b/nbgrader/preprocessors/execute.py index 6f84ee8b1..84bc21e77 100644 --- a/nbgrader/preprocessors/execute.py +++ b/nbgrader/preprocessors/execute.py @@ -5,6 +5,7 @@ from . import NbGraderPreprocessor from nbconvert.exporters.exporter import ResourcesDict from nbformat.notebooknode import NotebookNode +from jupyter_client.manager import AsyncKernelManager from typing import Any, Optional, Tuple @@ -63,6 +64,11 @@ class Execute(NbGraderPreprocessor, ExecutePreprocessor): """) ).tag(config=True) + def __init__(self, *args, **kwargs): + # nbconvert < 7.3.1 used the sync version of this, which doesn't work for us. + kwargs.setdefault('kernel_manager_class', AsyncKernelManager) + super().__init__(*args, **kwargs) + def on_cell_executed(self, **kwargs): cell = kwargs['cell'] reply = kwargs['execute_reply'] diff --git a/pyproject.toml b/pyproject.toml index 41de1a272..56a14c79b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ dependencies = [ "ipywidgets>=7.6", "Jinja2>=3", "jsonschema>=3", - "jupyter_client<8", + "jupyter_client<9", "jupyter_server>=1.12,<2", "jupyterlab<4", "jupyterlab_server",