Import pip requirements into Bazel.

## pip_repositories
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
pip_import(name, additional_buildtime_deps, additional_runtime_deps, pip_args, python, remove_runtime_deps, requirements, requirements_bzl)
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,
)
### Attributes
name

Name; Required

A unique name for this rule.

additional_buildtime_deps

Dictionary mapping strings to lists of strings; Optional; Default is {}

additional_runtime_deps

Dictionary mapping strings to lists of strings; Optional; Default is {}

pip_args

List of strings; Optional; Default is []

python

Label; Optional

remove_runtime_deps

Dictionary mapping strings to lists of strings; Optional; Default is {}

requirements

List of labels; Required

The label of a requirements.txt file.

requirements_bzl

Label; Optional

## pip_version_proxy
pip_version_proxy(name, define, python, values)
A rule for proxying requirements between different python runtimes. This rule generates a requirements.bzl file that provides a requirements() function that resolves to the correct version of python dependencies depending on the current python runtime. This is used via the WORKSPACE pattern:
pip_import(
    name = "pip_deps2",
    requirements = ["//:requirements-pip.txt"],
    python = "@python2//:bin/python",
)
pip_import(
    name = "pip_deps3",
    requirements = ["//:requirements-pip.txt"],
    python = "@python3//:bin/python",
)
load("@pip_deps2//:requirements.bzl", pip_install2 = "pip_install")
pip_install2()
load("@pip_deps3//:requirements.bzl", pip_install3 = "pip_install")
pip_install3()

pip_version_proxy(
    name = "pip_deps",
    define = "python",
    values = {
        "py2": "@pip_deps2",
        "py3": "@pip_deps3",
    },
)
When importing dependencies from a BUILD file with
load("@pip_deps//:requirements.bzl", "requirement")
py_library(
    name = "bar",
    ...
    deps = [
       requirement("mock"),
    ],
)
the requirement macro will resolve to pip_deps2 when building with --define python=py2, and to pip_deps3 when building with --define python=py3. ### Attributes
name

Name; Required

A unique name for this rule.

define

String; Optional; Default is ''

The key of the <code>--define</code> that selects the python version.

python

Label; Optional

values

Dictionary mapping strings to string; Optional; Default is {}

For each item in the dict, the key is the value of the <code>--define</code> to match, and the value is the name of the pip_import repository rule that provides the pip dependencies for that python runtime.