remove top level dirs from import
1 file changed
tree: da6dd6c51075f26041f712663f06f0d992f8cc2c
  1. third_party/
  2. tools/
  3. BUILD
  4. defs.bzl
  5. README.md
  6. requirements.txt
  7. WORKSPACE
README.md

rules_python_external

Contains Bazel rules to fetch and install Python dependencies from a requirements.txt file.

Usage

In requirements.txt

cryptography[test, docs]
boto3

In WORKSPACE

load("@rules_pip//:defs.bzl", "pip_repository")

pip_repository(
    name = "py_deps",
    requirements = "//:requirements.txt",
)

In BUILD

load("@py_deps//:requirements.bzl", "requirement")

py_binary(
    name = "main",
    srcs = ["main.py"],
    deps = [
        requirement("boto3"),
    ],
)