Skip to content

Commit f9092e8

Browse files
committed
Remove deprecated kernel_cmd trait
1 parent 96e23a8 commit f9092e8

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed

jupyter_client/manager.py

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -129,27 +129,6 @@ def kernel_spec(self) -> t.Optional[kernelspec.KernelSpec]:
129129
self._kernel_spec = self.kernel_spec_manager.get_kernel_spec(self.kernel_name)
130130
return self._kernel_spec
131131

132-
kernel_cmd: List = List(
133-
Unicode(),
134-
config=True,
135-
help="""DEPRECATED: Use kernel_name instead.
136-
137-
The Popen Command to launch the kernel.
138-
Override this if you have a custom kernel.
139-
If kernel_cmd is specified in a configuration file,
140-
Jupyter does not pass any arguments to the kernel,
141-
because it cannot make any assumptions about the
142-
arguments that the kernel understands. In particular,
143-
this means that the kernel does not receive the
144-
option --debug if it given on the Jupyter command line.
145-
""",
146-
)
147-
148-
def _kernel_cmd_changed(self, name, old, new):
149-
warnings.warn(
150-
"Setting kernel_cmd is deprecated, use kernel_spec to " "start different kernels."
151-
)
152-
153132
cache_ports: Bool = Bool(
154133
help="True if the MultiKernelManager should cache ports for this KernelManager instance"
155134
)
@@ -226,11 +205,8 @@ def client(self, **kwargs) -> KernelClient:
226205
def format_kernel_cmd(self, extra_arguments: t.Optional[t.List[str]] = None) -> t.List[str]:
227206
"""replace templated args (e.g. {connection_file})"""
228207
extra_arguments = extra_arguments or []
229-
if self.kernel_cmd:
230-
cmd = self.kernel_cmd + extra_arguments
231-
else:
232-
assert self.kernel_spec is not None
233-
cmd = self.kernel_spec.argv + extra_arguments
208+
assert self.kernel_spec is not None
209+
cmd = self.kernel_spec.argv + extra_arguments
234210

235211
if cmd and cmd[0] in {
236212
"python",
@@ -324,11 +300,10 @@ def pre_start_kernel(self, **kw) -> t.Tuple[t.List[str], t.Dict[str, t.Any]]:
324300
# Don't allow PYTHONEXECUTABLE to be passed to kernel process.
325301
# If set, it can bork all the things.
326302
env.pop("PYTHONEXECUTABLE", None)
327-
if not self.kernel_cmd:
328-
# If kernel_cmd has been set manually, don't refer to a kernel spec.
329-
# Environment variables from kernel spec are added to os.environ.
330-
assert self.kernel_spec is not None
331-
env.update(self._get_env_substitutions(self.kernel_spec.env, env))
303+
304+
# Environment variables from kernel spec are added to os.environ.
305+
assert self.kernel_spec is not None
306+
env.update(self._get_env_substitutions(self.kernel_spec.env, env))
332307

333308
kw["env"] = env
334309
return kernel_cmd, kw

0 commit comments

Comments
 (0)