euporie 2.8.10__tar.gz → 2.8.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {euporie-2.8.10 → euporie-2.8.11}/PKG-INFO +1 -1
- {euporie-2.8.10 → euporie-2.8.11}/euporie/console/tabs/console.py +4 -1
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/__init__.py +1 -1
- euporie-2.8.11/euporie/core/kernel/_settings.py +24 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/kernel/local.py +75 -1
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/_settings.py +7 -2
- {euporie-2.8.10 → euporie-2.8.11}/.gitignore +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/LICENSE +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/README.rst +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/console/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/console/__main__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/console/_commands.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/console/_settings.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/console/app.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/console/py.typed +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/console/tabs/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/__main__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/_settings.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/app/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/app/_commands.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/app/_settings.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/app/app.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/app/base.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/app/current.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/app/cursor.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/app/dummy.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/app/launch.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/bars/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/bars/command.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/bars/menu.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/bars/search.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/bars/status.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/border.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/clipboard.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/comm/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/comm/base.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/comm/ipywidgets.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/comm/registry.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/commands.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/completion.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/config.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/datum.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/ansi.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/base64.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/common.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/ft.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/html.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/jpeg.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/markdown.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/pdf.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/pil.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/png.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/rich.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/sixel.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/formats/svg.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/mime.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/registry.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/convert/utils.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/data_structures.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/diagnostics.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/filters.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/format.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/ft/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/ft/ansi.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/ft/html.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/ft/table.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/ft/utils.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/graphics.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/history.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/inspection.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/io.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/kernel/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/kernel/base.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/kernel/jupyter.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/kernel/jupyter_manager.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/bindings/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/bindings/basic.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/bindings/completion.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/bindings/micro.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/bindings/mouse.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/bindings/page_navigation.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/bindings/terminal.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/bindings/vi.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/key_processor.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/micro_state.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/registry.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/utils.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/key_binding/vi_state.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/keys.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/layout/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/layout/cache.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/layout/containers.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/layout/controls.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/layout/decor.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/layout/mouse.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/layout/print.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/layout/screen.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/layout/scroll.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/lexers.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/log.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/lsp.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/margins.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/path.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/processors.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/py.typed +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/pygments.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/reference.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/renderer.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/style.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/suggest.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/tabs/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/tabs/_commands.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/tabs/_settings.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/tabs/base.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/tabs/kernel.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/tabs/notebook.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/utils.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/validation.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/cell.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/cell_outputs.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/decor.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/dialog.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/display.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/file_browser.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/formatted_text_area.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/forms.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/inputs.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/layout.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/logo.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/menu.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/pager.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/palette.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/core/widgets/tree.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/data/desktop/euporie-console.desktop +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/data/desktop/euporie-notebook.desktop +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/hub/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/hub/__main__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/hub/app.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/hub/py.typed +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/__main__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/_commands.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/_settings.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/app.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/current.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/enums.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/filters.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/py.typed +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/tabs/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/tabs/_commands.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/tabs/_settings.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/tabs/display.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/tabs/edit.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/tabs/json.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/tabs/log.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/tabs/notebook.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/widgets/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/widgets/_commands.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/widgets/_settings.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/notebook/widgets/side_bar.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/preview/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/preview/__main__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/preview/_settings.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/preview/app.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/preview/py.typed +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/preview/tabs/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/preview/tabs/notebook.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/web/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/web/tabs/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/web/tabs/web.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/web/widgets/__init__.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/euporie/web/widgets/webview.py +0 -0
- {euporie-2.8.10 → euporie-2.8.11}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: euporie
|
3
|
-
Version: 2.8.
|
3
|
+
Version: 2.8.11
|
4
4
|
Summary: Euporie is a suite of terminal applications for interacting with Jupyter kernels
|
5
5
|
Project-URL: Documentation, https://euporie.readthedocs.io/en/latest
|
6
6
|
Project-URL: Issues, https://github.com/joouha/euporie/issues
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"""Defines kernel settings."""
|
2
|
+
|
3
|
+
from euporie.core.config import add_setting
|
4
|
+
|
5
|
+
add_setting(
|
6
|
+
name="warn_venv",
|
7
|
+
# Kernel implementations are loaded lazily, so we add kernel settings to the root
|
8
|
+
# kernel module group, causing them to get loaded before any kernel implementations
|
9
|
+
group="euporie.core.kernel",
|
10
|
+
flags=["--warn-venv"],
|
11
|
+
type_=bool,
|
12
|
+
default=True,
|
13
|
+
help_="Warn when running in a virtual environment",
|
14
|
+
description="""
|
15
|
+
When enabled, displays a warning message when the kernel is running inside a
|
16
|
+
virtual environment.
|
17
|
+
|
18
|
+
This can be helpful to remind users that they are working in an isolated Python
|
19
|
+
environment with potentially different package versions than their system Python
|
20
|
+
installation.
|
21
|
+
|
22
|
+
Disable this setting if you prefer not to see these warnings.
|
23
|
+
""",
|
24
|
+
)
|
@@ -6,12 +6,14 @@ import ast
|
|
6
6
|
import code
|
7
7
|
import getpass
|
8
8
|
import logging
|
9
|
+
import os
|
9
10
|
import sys
|
10
11
|
import threading
|
11
12
|
import traceback
|
12
13
|
from asyncio import to_thread
|
13
14
|
from functools import update_wrapper
|
14
15
|
from linecache import cache as line_cache
|
16
|
+
from pathlib import Path
|
15
17
|
from typing import TYPE_CHECKING, cast
|
16
18
|
|
17
19
|
from pygments import highlight
|
@@ -124,6 +126,77 @@ class LocalPythonKernel(BaseKernel):
|
|
124
126
|
if callable(set_status):
|
125
127
|
set_status(self.status)
|
126
128
|
|
129
|
+
def init_venv(self) -> None:
|
130
|
+
"""Add the current venv to sys.path so we can import modules from it.
|
131
|
+
|
132
|
+
This isn't perfect: it doesn't use the Python interpreter with which the
|
133
|
+
virtualenv was built, and it ignores the --no-site-packages option. A warning
|
134
|
+
will appear suggesting the user installs euporie in the virtualenv or to use a
|
135
|
+
Jupyter kernel, but for many cases, it probably works well enough.
|
136
|
+
|
137
|
+
Adapted from :py:mod:`IPython`.
|
138
|
+
"""
|
139
|
+
# Check if we are in a virtual environment
|
140
|
+
if "VIRTUAL_ENV" not in os.environ:
|
141
|
+
return
|
142
|
+
elif os.environ["VIRTUAL_ENV"] == "":
|
143
|
+
log.warning(
|
144
|
+
"The virtual environment path is set to '': "
|
145
|
+
"please check if this is intentional."
|
146
|
+
)
|
147
|
+
return
|
148
|
+
|
149
|
+
# Follow sys.executable symlink trail, recoding all paths along the way
|
150
|
+
# We need to check all of these
|
151
|
+
paths = [Path(sys.executable)]
|
152
|
+
while (path := paths[-1]).is_symlink():
|
153
|
+
new_path = path.readlink()
|
154
|
+
if not new_path.is_absolute():
|
155
|
+
new_path = path.parent / new_path
|
156
|
+
paths.append(new_path)
|
157
|
+
|
158
|
+
# Get the venv path
|
159
|
+
p_venv = Path(os.environ["VIRTUAL_ENV"]).resolve()
|
160
|
+
# In Cygwin paths like "c:\..." and '\cygdrive\c\...' are possible
|
161
|
+
if len(p_venv.parts) > 2 and p_venv.parts[1] == "cygdrive":
|
162
|
+
drive_name = p_venv.parts[2]
|
163
|
+
p_venv = (drive_name + ":/") / Path(*p_venv.parts[3:])
|
164
|
+
|
165
|
+
# Check if the executable is already inside or has access to the virtualenv
|
166
|
+
if any(p_venv == p.parents[1].resolve() for p in paths):
|
167
|
+
return
|
168
|
+
|
169
|
+
# Locate the site-packages of the virtual environment
|
170
|
+
if sys.platform == "win32":
|
171
|
+
virtual_env = str(Path(os.environ["VIRTUAL_ENV"], "Lib", "site-packages"))
|
172
|
+
else:
|
173
|
+
import re
|
174
|
+
|
175
|
+
virtual_env_path = Path(
|
176
|
+
os.environ["VIRTUAL_ENV"], "lib", "python{}.{}", "site-packages"
|
177
|
+
)
|
178
|
+
p_ver = sys.version_info[:2]
|
179
|
+
|
180
|
+
# Predict version from py[thon]-x.x in the $VIRTUAL_ENV
|
181
|
+
re_m = re.search(r"\bpy(?:thon)?([23])\.(\d+)\b", os.environ["VIRTUAL_ENV"])
|
182
|
+
if re_m:
|
183
|
+
predicted_path = Path(str(virtual_env_path).format(*re_m.groups()))
|
184
|
+
if predicted_path.exists():
|
185
|
+
p_ver = re_m.groups()
|
186
|
+
|
187
|
+
virtual_env = str(virtual_env_path).format(*p_ver)
|
188
|
+
|
189
|
+
if self.kernel_tab.app.config.warn_venv:
|
190
|
+
log.warning("Attempting to work in virtualenv %r.", virtual_env)
|
191
|
+
log.warning(
|
192
|
+
"If you encounter problems, please install euporie inside the virtual "
|
193
|
+
"environment, or use a Jupyter kernel."
|
194
|
+
)
|
195
|
+
import site
|
196
|
+
|
197
|
+
sys.path.insert(0, virtual_env)
|
198
|
+
site.addsitedir(virtual_env)
|
199
|
+
|
127
200
|
async def start_async(self) -> None:
|
128
201
|
"""Start the local interpreter."""
|
129
202
|
self.error = None
|
@@ -134,6 +207,7 @@ class LocalPythonKernel(BaseKernel):
|
|
134
207
|
set_execution_count := self.default_callbacks.get("set_execution_count")
|
135
208
|
):
|
136
209
|
set_execution_count(self.execution_count)
|
210
|
+
self.init_venv()
|
137
211
|
|
138
212
|
@property
|
139
213
|
def spec(self) -> dict[str, str]:
|
@@ -177,7 +251,7 @@ class LocalPythonKernel(BaseKernel):
|
|
177
251
|
colored_traceback = highlight(
|
178
252
|
traceback_text,
|
179
253
|
Python3TracebackLexer(),
|
180
|
-
Terminal256Formatter(style=
|
254
|
+
Terminal256Formatter(style=self.kernel_tab.app.config.syntax_theme),
|
181
255
|
).rstrip()
|
182
256
|
|
183
257
|
# Send the error through the callback
|
@@ -4,6 +4,7 @@ from prompt_toolkit.filters import buffer_has_focus
|
|
4
4
|
|
5
5
|
from euporie.core.app.current import get_app
|
6
6
|
from euporie.core.config import add_setting
|
7
|
+
from euporie.core.filters import tab_type_has_focus
|
7
8
|
|
8
9
|
# euporie.core.widgets.cell_outputs:CellOutputArea
|
9
10
|
|
@@ -14,12 +15,16 @@ add_setting(
|
|
14
15
|
flags=["--wrap-cell-outputs"],
|
15
16
|
type_=bool,
|
16
17
|
help_="Wrap cell output text.",
|
17
|
-
default=
|
18
|
+
default=True,
|
18
19
|
schema={"type": "boolean"},
|
19
20
|
description="""
|
20
21
|
Whether text-based cell outputs should be wrapped.
|
21
22
|
""",
|
22
|
-
cmd_filter
|
23
|
+
cmd_filter=(
|
24
|
+
~buffer_has_focus
|
25
|
+
& tab_type_has_focus("euporie.notebook.tabs.notebook.Notebook")
|
26
|
+
)
|
27
|
+
| ~tab_type_has_focus("euporie.notebook.tabs.notebook.Notebook"),
|
23
28
|
)
|
24
29
|
|
25
30
|
add_setting(
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|