From c6451bed5b06bb8f612b20fb0993a2fe4e0f0582 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 11 Mar 2026 16:04:14 +0100 Subject: [PATCH] run-task: use uv pip install --prefix instead of --target This way scripts end up in ~/.local/bin/ instead of ~/local/lib/python3.XX/site-packages/bin. --- src/taskgraph/run-task/run-task | 8 ++++---- test/test_scripts_run_task.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/taskgraph/run-task/run-task b/src/taskgraph/run-task/run-task index 856c24a4f..deca3a691 100755 --- a/src/taskgraph/run-task/run-task +++ b/src/taskgraph/run-task/run-task @@ -1044,8 +1044,8 @@ def install_pip_requirements(repositories): # TODO: Stop using system Python (#381) if shutil.which("uv"): - user_site_dir = subprocess.run( - [sys.executable, "-msite", "--user-site"], capture_output=True, text=True + user_base_dir = subprocess.run( + [sys.executable, "-msite", "--user-base"], capture_output=True, text=True ).stdout.strip() cmd = [ "uv", @@ -1053,8 +1053,8 @@ def install_pip_requirements(repositories): "install", "--python", sys.executable, - "--target", - user_site_dir, + "--prefix", + user_base_dir, ] else: cmd = [sys.executable, "-mpip", "install", "--user", "--break-system-packages"] diff --git a/test/test_scripts_run_task.py b/test/test_scripts_run_task.py index 83fd4e7b7..b2393721c 100644 --- a/test/test_scripts_run_task.py +++ b/test/test_scripts_run_task.py @@ -143,8 +143,8 @@ def test_install_pip_requirements_with_uv( "install", "--python", sys.executable, - "--target", - site.getusersitepackages(), + "--prefix", + site.getuserbase(), "--require-hashes", "-r", str(req),