fix: update virtualenv building so llamastack- prefix is not added, make notebook experience easier (#1225)

Make sure venv behaves like conda (no prefix is added to image_name) and
`--image-type venv` inside a notebook "just works" without any fiddling
This commit is contained in:
Ashwin Bharambe 2025-02-23 16:57:11 -08:00 committed by GitHub
parent 19ae4b35d9
commit 6227e1e3b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 39 additions and 19 deletions

View file

@ -22,6 +22,19 @@ def run_with_pty(command):
return _run_with_pty_unix(command)
def in_notebook():
try:
from IPython import get_ipython
if "IPKernelApp" not in get_ipython().config: # pragma: no cover
return False
except ImportError:
return False
except AttributeError:
return False
return True
# run a command in a pseudo-terminal, with interrupt handling,
# useful when you want to run interactive things
def _run_with_pty_unix(command):