Skip to content

Commit 63dcab9

Browse files
authored
fix: more uv variables set (#1056)
* fix: more uv variables set Signed-off-by: Henry Schreiner <[email protected]> * Apply suggestions from code review --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent e0f64e6 commit 63dcab9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

nox/virtualenv.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,11 @@ def __init__(
595595
if venv_backend not in {"virtualenv", "venv", "uv"}:
596596
msg = f"venv_backend {venv_backend!r} not recognized"
597597
raise ValueError(msg)
598-
super().__init__(env={"VIRTUAL_ENV": self.location, "CONDA_PREFIX": None})
598+
env = {"VIRTUAL_ENV": self.location, "CONDA_PREFIX": None}
599+
if self._venv_backend == "uv":
600+
env["UV_PROJECT_ENVIRONMENT"] = self.location
601+
env["UV_PYTHON"] = self.location
602+
super().__init__(env=env)
599603

600604
def _clean_location(self) -> bool:
601605
"""Deletes any existing virtual environment"""

0 commit comments

Comments
 (0)