Skip to content

Commit

Permalink
Fix jupyter qtconsole
Browse files Browse the repository at this point in the history
Resolves   #717.
  • Loading branch information
evhub committed Feb 3, 2023
1 parent d12cd99 commit a67bbe8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions coconut/command/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
mypy_builtin_regex,
coconut_pth_file,
error_color_code,
jupyter_console_commands,
)
from coconut.util import (
univ_open,
Expand Down Expand Up @@ -923,10 +924,9 @@ def start_jupyter(self, args):
logger.warn("could not find {name!r} kernel; using {kernel!r} kernel instead".format(name=icoconut_custom_kernel_name, kernel=kernel))

# pass the kernel to the console or otherwise just launch Jupyter now that we know our kernel is available
if args[0] == "console":
run_args = jupyter + ["console", "--kernel", kernel] + args[1:]
else:
run_args = jupyter + args
if args[0] in jupyter_console_commands:
args += ["--kernel", kernel]
run_args = jupyter + args

if newly_installed_kernels:
logger.show_sig("Successfully installed Jupyter kernels: '" + "', '".join(newly_installed_kernels) + "'")
Expand Down
2 changes: 2 additions & 0 deletions coconut/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,8 @@ def get_bool_env_var(env_var, default=False):

interpreter_compiler_var = "__coconut_compiler__"

jupyter_console_commands = ("console", "qtconsole")

# -----------------------------------------------------------------------------------------------------------------------
# HIGHLIGHTER CONSTANTS:
# -----------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion coconut/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
VERSION = "3.0.0"
VERSION_NAME = None
# False for release, int >= 1 for develop
DEVELOP = 7
DEVELOP = 8
ALPHA = True # for pre releases rather than post releases

# -----------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit a67bbe8

Please sign in to comment.