Import pip requirements into Bazel.

Macros and Functions

pip_import

kwargs

pip_install

Imports a requirements.txt file and generates a new requirements.bzl file.

This is used via the WORKSPACE pattern:

pip_install(
    requirements = ":requirements.txt",
)

You can then reference imported dependencies from your BUILD file with:

load("@pip//:requirements.bzl", "requirement")
py_library(
    name = "bar",
    ...
    deps = [
       "//my/other:dep",
       requirement("requests"),
       requirement("numpy"),
    ],
)

requirements

A 'requirements.txt' pip requirements file.

name

A unique name for the created external repository (default 'pip').

kwargs

Keyword arguments passed directly to the pip_repository repository rule.

pip_parse

requirements_lock

name

kwargs

pip_repositories