mirror of
https://github.com/astral-sh/uv
synced 2026-01-20 21:10:10 -05:00
Ensure we retain existing environment variables during python -m uv (#1667)
From https://github.com/astral-sh/uv/issues/1623#issuecomment-1951368507 I thought I checked this was working correctly in #1504 but I guess the environment is not preserved like I thought.
This commit is contained in:
@@ -50,10 +50,10 @@ def find_uv_bin() -> str:
|
||||
if __name__ == "__main__":
|
||||
uv = os.fsdecode(find_uv_bin())
|
||||
|
||||
env = {}
|
||||
env = os.environ.copy()
|
||||
venv = detect_virtualenv()
|
||||
if venv:
|
||||
env["VIRTUAL_ENV"] = venv
|
||||
env.setdefault("VIRTUAL_ENV", venv)
|
||||
|
||||
if sys.platform == "win32":
|
||||
import subprocess
|
||||
|
||||
Reference in New Issue
Block a user