diff --git a/docs/customize.md b/docs/customize.md index 954ec5ade..45a30ddb5 100644 --- a/docs/customize.md +++ b/docs/customize.md @@ -657,3 +657,11 @@ By default, VoilĂ 's grace period for kernel startup time is 60 seconds. It can ```sh voila --VoilaExecutor.startup_timeout=60 ``` + +## Have voila attempt to solve a best fit kernel spec + +By default, VoilĂ  will attempt to resolve a kernel spec to the best fit, based on the available environments. You can disable this functionality as follows: + +```py +c.VoilaConfiguration.attempt_fix_notebook = False +``` diff --git a/voila/configuration.py b/voila/configuration.py index 03ba6a44e..e44fb338f 100644 --- a/voila/configuration.py +++ b/voila/configuration.py @@ -211,3 +211,9 @@ def _valid_file_blacklist(self, proposal): help="""The dictionary of extension configuration, this dict is passed to the frontend through the PageConfig""", ) + + attempt_fix_notebook = Bool( + True, + config=True, + help="""Whether or not voila should attempt to fix and resolve a notebooks kernelspec metadata""", + ) diff --git a/voila/notebook_renderer.py b/voila/notebook_renderer.py index 59c182bf0..2ba094e59 100644 --- a/voila/notebook_renderer.py +++ b/voila/notebook_renderer.py @@ -312,7 +312,8 @@ async def load_notebook(self, path): __, extension = os.path.splitext(model.get("path", "")) if model.get("type") == "notebook": notebook = model["content"] - notebook = await self.fix_notebook(notebook) + if self.voila_configuration.attempt_fix_notebook: + notebook = await self.fix_notebook(notebook) return notebook elif extension in self.voila_configuration.extension_language_mapping: language = self.voila_configuration.extension_language_mapping[extension]