Skip to content

Commit

Permalink
fix: use uv python install only with uv backend (#900)
Browse files Browse the repository at this point in the history
* Use `uv python install` only with uv backend

fix #899

* fix: include encoding on Windows

* tests: indicate installing Python interp not tested

Signed-off-by: Henry Schreiner <[email protected]>

---------

Signed-off-by: Henry Schreiner <[email protected]>
Co-authored-by: Henry Schreiner <[email protected]>
  • Loading branch information
oliversen and henryiii authored Jan 17, 2025
1 parent 642c8bb commit a02eb79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nox/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def locate_via_py(version: str) -> str | None:
check=False,
text=True,
capture_output=True,
encoding="utf-8",
)
if ret.returncode == 0 and ret.stdout:
return ret.stdout.strip()
Expand Down Expand Up @@ -586,7 +587,9 @@ def _resolved_interpreter(self) -> str:
self._resolved = cleaned_interpreter
return self._resolved

if HAS_UV and UV_PYTHON_SUPPORT:
if (
self.venv_backend == "uv" and HAS_UV and UV_PYTHON_SUPPORT
): # pragma: nocover
uv_python_success = uv_install_python(cleaned_interpreter)
if uv_python_success:
self._resolved = cleaned_interpreter
Expand Down

0 comments on commit a02eb79

Please sign in to comment.