Skip to content

Commit

Permalink
fix(run-task): pass '--break-system-packages' when installing pip req…
Browse files Browse the repository at this point in the history
…uirements

This is needed on newer Pythons that raise an error when attempting to
pip install to the system installation.
  • Loading branch information
ahal committed Dec 6, 2023
1 parent 109fb07 commit 783774e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/taskgraph/run-task/run-task
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,8 @@ def install_pip_requirements(repositories):
if not requirements:
return

cmd = [sys.executable, "-mpip", "install"]
# TODO: Stop using system Python (#381)
cmd = [sys.executable, "-mpip", "install", "--break-system-packages"]
if os.environ.get("PIP_DISABLE_REQUIRE_HASHES") != "1":
cmd.append("--require-hashes")

Expand Down
2 changes: 2 additions & 0 deletions test/test_scripts_run_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_install_pip_requirements(
sys.executable,
"-mpip",
"install",
"--break-system-packages",
"--require-hashes",
"-r",
str(req),
Expand All @@ -101,6 +102,7 @@ def test_install_pip_requirements(
sys.executable,
"-mpip",
"install",
"--break-system-packages",
"--require-hashes",
"-r",
str(req),
Expand Down

0 comments on commit 783774e

Please sign in to comment.