Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(decision): cleanup temporary uv lockfiles #594

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/taskgraph/run-task/run-task
Original file line number Diff line number Diff line change
Expand Up @@ -1012,9 +1012,10 @@ def install_pip_requirements(repositories):

# TODO: Stop using system Python (#381)
if shutil.which("uv"):
cmd = ["uv", "pip", "install", "--python", sys.executable, "--break-system-packages"]
user_site_dir = subprocess.run([sys.executable, "-msite", "--user-site"], capture_output=True, text=True).stdout.strip()
cmd = ["uv", "pip", "install", "--python", sys.executable, "--target", user_site_dir]
else:
cmd = [sys.executable, "-mpip", "install", "--break-system-packages"]
cmd = [sys.executable, "-mpip", "install", "--user", "--break-system-packages"]

if os.environ.get("PIP_DISABLE_REQUIRE_HASHES") != "1":
cmd.append("--require-hashes")
Expand Down
1 change: 1 addition & 0 deletions taskcluster/docker/decision/system-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ apt-get clean
apt-get autoclean
rm -rf /var/lib/apt/lists/
rm -rf /setup
rm /tmp/uv-*.lock
6 changes: 5 additions & 1 deletion test/test_scripts_run_task.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io
import os
import site
import stat
import subprocess
import sys
Expand Down Expand Up @@ -85,6 +86,7 @@ def test_install_pip_requirements(
sys.executable,
"-mpip",
"install",
"--user",
"--break-system-packages",
"--require-hashes",
"-r",
Expand All @@ -105,6 +107,7 @@ def test_install_pip_requirements(
sys.executable,
"-mpip",
"install",
"--user",
"--break-system-packages",
"--require-hashes",
"-r",
Expand Down Expand Up @@ -137,7 +140,8 @@ def test_install_pip_requirements_with_uv(
"install",
"--python",
sys.executable,
"--break-system-packages",
"--target",
site.getusersitepackages(),
"--require-hashes",
"-r",
str(req),
Expand Down
Loading