fix for https://github.com/bazelbuild/bazel/issues/3998
1 file changed
tree: cc0053bd429f3963388b6fe47ced0246bf8bd920
  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"),
    ],
)