File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ docs = [
50
50
" sphinx-issues >= 3.0.0" ,
51
51
]
52
52
test = [
53
- " build[virtualenv]" ,
53
+ " build[uv, virtualenv]" ,
54
54
" filelock >= 3" ,
55
55
" pytest >= 6.2.4" ,
56
56
" pytest-cov >= 2.12" ,
@@ -62,15 +62,18 @@ test = [
62
62
' setuptools >= 56.0.0; python_version == "3.10"' ,
63
63
' setuptools >= 56.0.0; python_version == "3.11"' ,
64
64
' setuptools >= 67.8.0; python_version >= "3.12"' ,
65
- " uv >= 0.1.15" ,
66
65
]
67
66
typing = [
67
+ " build[uv]" ,
68
68
" importlib-metadata >= 5.1" ,
69
69
" mypy ~= 1.5.0" ,
70
70
" tomli" ,
71
71
" typing-extensions >= 3.7.4.3" ,
72
72
" uv >= 0.1.15" ,
73
73
]
74
+ uv = [
75
+ " uv >= 0.1.15" ,
76
+ ]
74
77
virtualenv = [
75
78
" virtualenv >= 20.0.35" ,
76
79
]
Original file line number Diff line number Diff line change @@ -282,10 +282,19 @@ def create(self, path: str) -> None:
282
282
283
283
self ._env_path = path
284
284
285
- uv_bin = shutil .which ('uv' )
285
+ # ``uv.find_uv_bin`` will look for uv in the user prefix if it can't
286
+ # find it under ``sys.prefix``, essentially potentially rearranging
287
+ # the user's $PATH. We'll only look for uv under the prefix of
288
+ # the running interpreter for unactivated venvs then defer to $PATH.
289
+ uv_bin = shutil .which ('uv' , path = sysconfig .get_path ('scripts' ))
290
+
291
+ if not uv_bin :
292
+ uv_bin = shutil .which ('uv' )
293
+
286
294
if not uv_bin :
287
295
msg = 'uv executable missing'
288
296
raise RuntimeError (msg )
297
+
289
298
self ._uv_bin = uv_bin
290
299
291
300
if sys .implementation .name == 'pypy' :
Original file line number Diff line number Diff line change 6
6
import subprocess
7
7
import sys
8
8
import sysconfig
9
+ import typing
9
10
10
11
from pathlib import Path
11
12
from types import SimpleNamespace
@@ -64,6 +65,7 @@ def test_venv_executable_missing_post_creation(
64
65
assert venv_create .call_count == 1
65
66
66
67
68
+ @typing .no_type_check
67
69
def test_isolated_env_abstract ():
68
70
with pytest .raises (TypeError ):
69
71
build .env .IsolatedEnv ()
You can’t perform that action at this time.
0 commit comments