fix: use prompt in standalone venvs

This commit is contained in:
Daylin Morgan 2023-08-03 18:31:56 -05:00
parent b08eeb1c71
commit ae30ff2b84
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -52,7 +52,7 @@ from typing import (
from urllib.error import HTTPError
from urllib.request import urlopen
__version__ = "23.5a7"
__version__ = "23.5a7-1-g86f4773-dev"
class Spinner:
@ -347,7 +347,7 @@ class Template:
_id = sha256.hexdigest()
if (env := cache / (name if name else _id)) not in cache.glob("*/") or force:
sys.stderr.write(f"generating new vivenv -> {env.name}\n")
venv.create(env, symlinks=True, clear=True)
venv.create(env, prompt=f"viv-{name}", symlinks=True, clear=True)
kw = dict(zip(("stdout", "stderr"), ((None,) * 2 if verbose else (-1, 2))))
cmd = ["pip", "--python", str(env / "bin" / "python"), "install", *spec]
p = run(cmd, **kw)