whl_library

whl_library(name, extras, python_interpreter, requirements, whl)

A rule for importing .whl dependencies into Bazel.

This rule is currently used to implement pip_import. It is not intended to work standalone, and the interface may change. See pip_import for proper usage.

This rule imports a .whl file as a py_library:

whl_library(
    name = "foo",
    whl = ":my-whl-file",
    requirements = "name of pip_import rule",
)

This rule defines @foo//:pkg as a py_library target.

Attributes

name Name; required

A unique name for this repository.

extras List of strings; optional

A subset of the "extras" available from this .whl for which requirements has the dependencies.

python_interpreter String; optional

The command to run the Python interpreter used when unpacking the wheel.

requirements String; optional

The name of the pip_import repository rule from which to load this .whl's dependencies.

whl Label; required

The path to the .whl file. The name is expected to follow [this convention](https://www.python.org/dev/peps/pep-0427/#file-name-convention)).