Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Stop installing `<PROJECT>_PIP_REQUIREMENTS` into system Python with `run-task`

Đang mở
#381 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
devops, tooling

Hướng nghiên cứu

Locate the run-task entry point that handles the _PIP_REQUIREMENTS variable and inspect how it installs the cloned repository's requirements. Compare the virtualenv and non-system-Python approaches described in the issue, then verify that bootstrapping works on Debian 12 without installing into system Python.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When a repo sets the <PROJECT>_PIP_REQUIREMENTS variable, run-task will automatically install the requirements file after cloning the repo. This is primarily used for bootstrapping Taskgraph in the Decision task, but can also be used for other things.

We recently upgraded the image to Debian 12, which includes Python 3.11. This version of Python fails when you attempt to pip install into the system Python:

[pip-install 2023-12-05T21:39:50.324Z] × This environment is externally managed
[pip-install 2023-12-05T21:39:50.324Z] ╰─> To install Python packages system-wide, try apt install
[pip-install 2023-12-05T21:39:50.324Z]     python3-xyz, where xyz is the package you are trying to
[pip-install 2023-12-05T21:39:50.324Z]     install.
[pip-install 2023-12-05T21:39:50.324Z]     
[pip-install 2023-12-05T21:39:50.324Z]     If you wish to install a non-Debian-packaged Python package,
[pip-install 2023-12-05T21:39:50.324Z]     create a virtual environment using python3 -m venv path/to/venv.
[pip-install 2023-12-05T21:39:50.324Z]     Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
[pip-install 2023-12-05T21:39:50.324Z]     sure you have python3-full installed.
[pip-install 2023-12-05T21:39:50.324Z]     
[pip-install 2023-12-05T21:39:50.324Z]     If you wish to install a non-Debian packaged Python application,
[pip-install 2023-12-05T21:39:50.324Z]     it may be easiest to use pipx install xyz, which will manage a
[pip-install 2023-12-05T21:39:50.324Z]     virtual environment for you. Make sure you have pipx installed.
[pip-install 2023-12-05T21:39:50.324Z]     
[pip-install 2023-12-05T21:39:50.324Z]     See /usr/share/doc/python3.11/README.venv for more information.

We'll work around this by passing --break-system-packages for now (this is probably fine anyway, especially with Docker). But it highlights some poor behaviour. It would be better to create a virtualenv first or use a non-system Python (perhaps installed via pyenv).

Ngôn ngữ chính
Python
Star
26
Fork
55
Merge trung bình
2 ngày 6 phút
Pull request đã merge (30 ngày)
15

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của taskcluster/taskgraph

Tất cả issue của taskcluster/taskgraph

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.