Skip to content

Commit 4aacfff

Browse files
authored
run-task: use uv pip install --prefix instead of --target (#919)
This way scripts end up in ~/.local/bin/ instead of ~/local/lib/python3.XX/site-packages/bin.
1 parent 6d0b1e2 commit 4aacfff

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/taskgraph/run-task/run-task

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,17 +1044,17 @@ def install_pip_requirements(repositories):
10441044

10451045
# TODO: Stop using system Python (#381)
10461046
if shutil.which("uv"):
1047-
user_site_dir = subprocess.run(
1048-
[sys.executable, "-msite", "--user-site"], capture_output=True, text=True
1047+
user_base_dir = subprocess.run(
1048+
[sys.executable, "-msite", "--user-base"], capture_output=True, text=True
10491049
).stdout.strip()
10501050
cmd = [
10511051
"uv",
10521052
"pip",
10531053
"install",
10541054
"--python",
10551055
sys.executable,
1056-
"--target",
1057-
user_site_dir,
1056+
"--prefix",
1057+
user_base_dir,
10581058
]
10591059
else:
10601060
cmd = [sys.executable, "-mpip", "install", "--user", "--break-system-packages"]

test/test_scripts_run_task.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ def test_install_pip_requirements_with_uv(
143143
"install",
144144
"--python",
145145
sys.executable,
146-
"--target",
147-
site.getusersitepackages(),
146+
"--prefix",
147+
site.getuserbase(),
148148
"--require-hashes",
149149
"-r",
150150
str(req),

0 commit comments

Comments
 (0)