From 7ea547aec81cf52607350749b70d966caf6782c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 May 2021 20:32:19 +0000 Subject: [PATCH 1/3] Bump traitlets from 4.3.3 to 5.0.5 Bumps [traitlets](https://github.com/ipython/traitlets) from 4.3.3 to 5.0.5. - [Release notes](https://github.com/ipython/traitlets/releases) - [Commits](https://github.com/ipython/traitlets/compare/4.3.3...5.0.5) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4e511417f..483ec534b 100644 --- a/setup.py +++ b/setup.py @@ -91,7 +91,7 @@ "notebook>=4.2", "nbconvert==5.6.1", "nbformat", - "traitlets==4.3.3", + "traitlets==5.0.5", "jupyter_core", "jupyter_client", "tornado", From 5edefb3b55dbda3b20ba8c4835111b058d564170 Mon Sep 17 00:00:00 2001 From: "Jessica B. Hamrick" Date: Wed, 5 May 2021 20:46:18 +0100 Subject: [PATCH 2/3] Don't set histfile via extra arguments, as the base execute preprocessor does this already --- nbgrader/preprocessors/execute.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nbgrader/preprocessors/execute.py b/nbgrader/preprocessors/execute.py index 29b09ea0f..f2d330374 100644 --- a/nbgrader/preprocessors/execute.py +++ b/nbgrader/preprocessors/execute.py @@ -38,10 +38,6 @@ def preprocess(self, resources: ResourcesDict, retries: Optional[Any] = None ) -> Tuple[NotebookNode, ResourcesDict]: - kernel_name = nb.metadata.get('kernelspec', {}).get('name', 'python') - if self.extra_arguments == [] and kernel_name == "python": - self.extra_arguments = ["--HistoryManager.hist_file=:memory:"] - if retries is None: retries = self.execute_retries From df99a679ab002ec000fe33cb640ff59ff7a5f9a3 Mon Sep 17 00:00:00 2001 From: "Jessica B. Hamrick" Date: Wed, 5 May 2021 21:05:37 +0100 Subject: [PATCH 3/3] Fix bug with duplicate hist_file --- nbgrader/preprocessors/execute.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nbgrader/preprocessors/execute.py b/nbgrader/preprocessors/execute.py index f2d330374..04d8773d7 100644 --- a/nbgrader/preprocessors/execute.py +++ b/nbgrader/preprocessors/execute.py @@ -38,6 +38,11 @@ def preprocess(self, resources: ResourcesDict, retries: Optional[Any] = None ) -> Tuple[NotebookNode, ResourcesDict]: + # This gets added in by the parent execute preprocessor, so if it's already in our + # extra arguments we need to delete it or traitlets will be unhappy. + if '--HistoryManager.hist_file=:memory:' in self.extra_arguments: + self.extra_arguments.remove('--HistoryManager.hist_file=:memory:') + if retries is None: retries = self.execute_retries