mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-12-22 10:40:44 -06:00
fix: properly reuse existing env
This commit is contained in:
parent
3bf000f4d0
commit
57cd470bd4
1 changed files with 11 additions and 7 deletions
|
@ -55,7 +55,7 @@ from typing import (
|
||||||
from urllib.error import HTTPError
|
from urllib.error import HTTPError
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
|
||||||
__version__ = "23.8b1-3-g5db225a-dev"
|
__version__ = "23.8b1-4-g3bf000f-dev"
|
||||||
|
|
||||||
|
|
||||||
class Spinner:
|
class Spinner:
|
||||||
|
@ -1708,8 +1708,11 @@ class Viv:
|
||||||
os.environ["VIV_CACHE"] = tmpdir
|
os.environ["VIV_CACHE"] = tmpdir
|
||||||
|
|
||||||
if viv_used:
|
if viv_used:
|
||||||
env.update({"VIV_SPEC": " ".join(f"'{req}'" for req in spec)})
|
log.debug(f"script invokes viv.use passing along spec: \n '{spec}'")
|
||||||
subprocess_run_quit([sys.executable, "-S", scriptpath, *rest], env=env)
|
subprocess_run_quit(
|
||||||
|
[sys.executable, "-S", scriptpath, *rest],
|
||||||
|
env=dict(env, VIV_SPEC=" ".join(f"'{req}'" for req in spec)),
|
||||||
|
)
|
||||||
elif not spec and not deps:
|
elif not spec and not deps:
|
||||||
log.warning("using viv with empty spec, skipping vivenv creation")
|
log.warning("using viv with empty spec, skipping vivenv creation")
|
||||||
subprocess_run_quit([sys.executable, "-S", scriptpath, *rest])
|
subprocess_run_quit([sys.executable, "-S", scriptpath, *rest])
|
||||||
|
@ -1720,11 +1723,12 @@ class Viv:
|
||||||
vivenv.meta.write()
|
vivenv.meta.write()
|
||||||
subprocess_run_quit(
|
subprocess_run_quit(
|
||||||
[vivenv.python, "-S", scriptpath, *rest],
|
[vivenv.python, "-S", scriptpath, *rest],
|
||||||
env={
|
env=dict(
|
||||||
"PYTHONPATH": ":".join(
|
env,
|
||||||
|
PYTHONPATH=":".join(
|
||||||
filter(None, (vivenv.site_packages, Env().pythonpath))
|
filter(None, (vivenv.site_packages, Env().pythonpath))
|
||||||
)
|
),
|
||||||
},
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
def cmd_run(
|
def cmd_run(
|
||||||
|
|
Loading…
Reference in a new issue