fix: consistently use find_uv for our usage of uv (#2730)
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
This commit is contained in:
@@ -5,7 +5,7 @@ import platform as platform_module
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import textwrap
|
import textwrap
|
||||||
from collections.abc import MutableMapping, Set
|
from collections.abc import MutableMapping, Sequence, Set
|
||||||
from functools import cache
|
from functools import cache
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import assert_never
|
from typing import assert_never
|
||||||
@@ -588,7 +588,12 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
)
|
)
|
||||||
shell(before_test_prepared, env=virtualenv_env)
|
shell(before_test_prepared, env=virtualenv_env)
|
||||||
|
|
||||||
pip = ["uv", "pip"] if use_uv else ["pip"]
|
pip: Sequence[Path | str]
|
||||||
|
if use_uv:
|
||||||
|
assert uv_path is not None
|
||||||
|
pip = [uv_path, "pip"]
|
||||||
|
else:
|
||||||
|
pip = ["pip"]
|
||||||
|
|
||||||
# install the wheel
|
# install the wheel
|
||||||
call(
|
call(
|
||||||
|
|||||||
@@ -108,7 +108,9 @@ def virtualenv(
|
|||||||
assert python.exists()
|
assert python.exists()
|
||||||
|
|
||||||
if use_uv:
|
if use_uv:
|
||||||
call("uv", "venv", venv_path, "--python", python)
|
uv_path = find_uv()
|
||||||
|
assert uv_path is not None
|
||||||
|
call(uv_path, "venv", venv_path, "--python", python)
|
||||||
else:
|
else:
|
||||||
virtualenv_app, virtualenv_version = _ensure_virtualenv(version)
|
virtualenv_app, virtualenv_version = _ensure_virtualenv(version)
|
||||||
if pip_version is None:
|
if pip_version is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user