Missing pip dependencies with venvs_site_packages=yes
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
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python
- Lĩnh vực
- build-system, testing
Hướng nghiên cứu
Bắt đầu với rule py_test và tái hiện lỗi logger_tests_py_test được mô tả trong traceback, sử dụng venvs_site_packages=yes. Kiểm tra môi trường ảo được tạo và cách xử lý dependency cho pytest, py, pluggy và iniconfig; issue được hoàn tất khi các package bắc cầu mà pytest yêu cầu luôn hiện diện nhất quán và target chạy thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🐞 bug report
Affected Rule
The issue is caused by the rule: `py_test`Is this a regression?
NoDescription
Pip dependencies are missing for py_test targets.- Ex:
pytestpip package depends onpypip package. Addingpytestto thedepsforpy_testdoesn't include its transitive dependencies, e.g.py(and others). It does include some transitive dependencies though, e.g.pluggy - In the above example, adding
pyas an explicit dependency indepsfixes the problem as it gets included in the generated venv. However, this 'fix' doesn't work foriniconfig, another missing transitive dependency ofpytest- it doesn't get included in the venv
🔬 Minimal Reproduction
🔥 Exception or Error
Traceback (most recent call last):
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/sandbox/linux-sandbox/890/execroot/_main/bazel-out/k8-opt/bin/barrel/core/common/logger/logger_tests_py_test.runfiles/_main/barrel/cor
e/common/logger/_logger_tests_py_test_actual_stage2_bootstrap.py", line 537, in
main()
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/sandbox/linux-sandbox/890/execroot/_main/bazel-out/k8-opt/bin/barrel/core/common/logger/logger_tests_py_test.runfiles/_main/barrel/cor
e/common/logger/_logger_tests_py_test_actual_stage2_bootstrap.py", line 531, in main
_run_py_path(main_filename, args=sys.argv[1:])
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/sandbox/linux-sandbox/890/execroot/_main/bazel-out/k8-opt/bin/barrel/core/common/logger/logger_tests_py_test.runfiles/_main/barrel/cor
e/common/logger/_logger_tests_py_test_actual_stage2_bootstrap.py", line 319, in _run_py_path
runpy.run_path(main_filename, run_name="__main__")
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/execroot/_main/external/rules_python++python+python_3_10_x86_64-unknown-linux-gnu/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/execroot/_main/external/rules_python++python+python_3_10_x86_64-unknown-linux-gnu/lib/python3.10/runpy.py", line 96, in _run_module_co
de
_run_code(code, mod_globals, init_globals,
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/execroot/_main/external/rules_python++python+python_3_10_x86_64-unknown-linux-gnu/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/sandbox/linux-sandbox/890/execroot/_main/bazel-out/k8-opt/bin/barrel/core/common/logger/logger_tests_py_test.runfiles/_main/build_supp
ort/python/pytest_proxy.py", line 7, in
from pytest import console_main
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/sandbox/linux-sandbox/890/execroot/_main/bazel-out/k8-opt/bin/barrel/core/common/logger/logger_tests_py_test.runfiles/_main/barrel/cor
e/common/logger/_logger_tests_py_test_actual.venv/lib/python3.10/site-packages/pytest/__init__.py", line 6, in
from _pytest.assertion import register_assert_rewrite
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/sandbox/linux-sandbox/890/execroot/_main/bazel-out/k8-opt/bin/barrel/core/common/logger/logger_tests_py_test.runfiles/_main/barrel/cor
e/common/logger/_logger_tests_py_test_actual.venv/lib/python3.10/site-packages/_pytest/assertion/__init__.py", line 9, in
from _pytest.assertion import rewrite
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/sandbox/linux-sandbox/890/execroot/_main/bazel-out/k8-opt/bin/barrel/core/common/logger/logger_tests_py_test.runfiles/_main/barrel/cor
e/common/logger/_logger_tests_py_test_actual.venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 34, in
from _pytest.assertion import util
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/sandbox/linux-sandbox/890/execroot/_main/bazel-out/k8-opt/bin/barrel/core/common/logger/logger_tests_py_test.runfiles/_main/barrel/cor
e/common/logger/_logger_tests_py_test_actual.venv/lib/python3.10/site-packages/_pytest/assertion/util.py", line 19, in
from _pytest.config import Config
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/sandbox/linux-sandbox/890/execroot/_main/bazel-out/k8-opt/bin/barrel/core/common/logger/logger_tests_py_test.runfiles/_main/barrel/cor
e/common/logger/_logger_tests_py_test_actual.venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 45, in
from .findpaths import determine_setup
File "/scratch/nikolay_nikolov/.cache/bazel/_bazel_nikolay_nikolov/79bf5e678fbb2019f1e30944a206f079/sandbox/linux-sandbox/890/execroot/_main/bazel-out/k8-opt/bin/barrel/core/common/logger/logger_tests_py_test.runfiles/_main/barrel/cor
e/common/logger/_logger_tests_py_test_actual.venv/lib/python3.10/site-packages/_pytest/config/findpaths.py", line 12, in
import iniconfig
ModuleNotFoundError: No module named 'iniconfig'
🌍 Your Environment
Operating System:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 13 (trixie)
Release: 13
Codename: trixie
Output of bazel version:
Build label: 8.3.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Jun 30 16:23:40 2025 (1751300620)
Build timestamp: 1751300620
Build timestamp as int: 1751300620
Rules_python version:
1.9.0
Anything else relevant?
No
- Ngôn ngữ chính
- Starlark
- Star
- 690
- Fork
- 722
- Merge trung bình
- 1 ngày 55 phút
- Pull request đã merge (30 ngày)
- 38
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bazel-contrib/rules_python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
bazel-contrib/rules_python#4179 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bazel-contrib/rules_python#4164 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
bazel-contrib/rules_python#3821 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
bazel-contrib/rules_python#4181 ·
-
Release 2.4.0 Đang mởtype: release
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
bazel-contrib/rules_python#4175 · 3 bình luận ·
Tất cả issue của bazel-contrib/rules_python
Issue tương tự
-
nix: vendorHash is outdated Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
typelevel/sbt-typelevel#929 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
openSUSE/python-rpm-macros#219 ·
-
HMR stops working Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Qiskit/mcp-servers#221 ·