Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Missing pip dependencies with venvs_site_packages=yes

Aberta
#3,672 5 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
38/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Pouca atividade
Stack de tecnologia
python
Domínio
build-system, testing

Direção de pesquisa

Comece com a regra py_test e reproduza a falha de logger_tests_py_test descrita no traceback, usando venvs_site_packages=yes. Inspecione o ambiente virtual gerado e o tratamento de dependências de pytest, py, pluggy e iniconfig; a issue estará concluída quando os pacotes transitivos exigidos por pytest estiverem presentes de forma consistente e o target for executado com sucesso.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

🐞 bug report

Affected Rule
The issue is caused by the rule: `py_test`
Is this a regression?
No
Description
Pip dependencies are missing for py_test targets.
  1. Ex: pytest pip package depends on py pip package. Adding pytest to the deps for py_test doesn't include its transitive dependencies, e.g. py (and others). It does include some transitive dependencies though, e.g. pluggy
  2. In the above example, adding py as an explicit dependency in deps fixes the problem as it gets included in the generated venv. However, this 'fix' doesn't work for iniconfig, another missing transitive dependency of pytest - 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

Linguagem predominante
Starlark
Estrelas
687
Forks
726
Merge médio
1d 3h
PRs com merge (30d)
83

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de bazel-contrib/rules_python

Todas as issues de bazel-contrib/rules_python

Issues semelhantes

Mais issues de Build System

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.