pip_repositories()
Pull in dependencies needed for pulling in pip dependencies.
A placeholder method that will eventually pull in any dependencies needed to install pip dependencies.
pip_import(name, requirements)
A rule for importing requirements.txt
dependencies into Bazel.
This rule imports a requirements.txt
file and generates a new
requirements.bzl
file. This is used via the WORKSPACE
pattern:
pip_import(
name = "foo",
requirements = ":requirements.txt",
)
load("@foo//:requirements.bzl", "pip_install")
pip_install()
You can then reference imported dependencies from your BUILD
file with:
load("@foo//:requirements.bzl", "requirement")
py_library(
name = "bar",
...
deps = [
"//my/other:dep",
requirement("futures"),
requirement("mock"),
],
)
Or alternatively:
load("@foo//:requirements.bzl", "all_requirements")
py_binary(
name = "baz",
...
deps = [
":foo",
] + all_requirements,
)
name |
A unique name for this rule. |
requirements |
The label of a requirements.txt file. |