Skip to content

Need to supply transitive dependencies  #1923

@bashtavenko

Description

@bashtavenko

🐞 bug report

Affected Rule

bazel_dep(name = "rules_python", version = "0.32.2")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
    hub_name = "pip_deps",
    python_version = "3.11",
    requirements_lock = "//:requirements.txt",
)
use_repo(pip, "pip_deps")

Is this a regression?

Not sure

Description

A clear and concise description of the problem...

After bazel buld //... bazel wants to see a transitive dependency. For example, I have "requests" in "requirements.txt" and it wants idna or urllib3 which are transitive dependeancies of the requests.

See full code here
https://github.com/bashtavenko/py/tree/pydeps-2

This is the first time I tried using bazel in Python project and it is likely I messed up something.

🔬 Minimal Reproduction

git clone -b pydeps-2 https://github.com/bashtavenko/py.git
cd py
bazel build //...

🔥 Exception or Error




Starting local Bazel server and connecting to it...
ERROR: no such package '@@rules_python~~pip~pip_deps//idna': BUILD file not found in directory 'idna' of external repository @@rules_python~~pip~pip_deps. Add a BUILD file to a directory to mark it as a package.
ERROR: C:/users/sb/_bazel_sb/enxgtwle/external/rules_python~~pip~pip_deps_311_requests/BUILD.bazel:28:11: no such package '@@rules_python~~pip~pip_deps//idna': BUILD file not found in directory 'idna' of external repository @@rules_python~~pip~pip_deps. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_python~~pip~pip_deps_311_requests//:pkg'
Target //:graph_lib up-to-date (nothing to build)
ERROR: Analysis of target '//:graph_test' failed; build aborted: Analysis failed
INFO: Elapsed time: 76.797s, Critical Path: 0.13s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

🌍 Your Environment

Operating System:

  
Microsoft Windows 10 Pro
  

Output of bazel version:

  
bazel 7.1.2
  

Rules_python version:

  
0.32.2
  

Anything else relevant?
This is most likely not a bug but rather a configuration that I missed.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions