Skip to content

Commit

Permalink
Only import nbconvert when execute=True is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Dec 19, 2023
1 parent e0466fc commit 0e8aa86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nbparameterise/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import re
from warnings import warn

from nbconvert.preprocessors import ExecutePreprocessor

class Parameter(object):
def __init__(self, name, vtype, value=None, metadata=None, comment=None):
Expand Down Expand Up @@ -183,6 +182,7 @@ def replace_definitions(nb, values, execute=False, execute_resources=None,
cell.source = drv.build_definitions(values, prev_code=cell.source)
if execute:
warn("execute=True is deprecated, use nbclient instead", stacklevel=2)
from nbconvert.preprocessors import ExecutePreprocessor
resources = execute_resources or {}
nb, resources = ExecutePreprocessor().preprocess(nb, resources)
return nb

0 comments on commit 0e8aa86

Please sign in to comment.