blob: 41467ceebb3954699dd37376dad447761eba2ba4 [file] [log] [blame] [view]
<!---
Documentation generated by Skydoc
-->
<h1>Import .whl files into Bazel.</h1>
<nav class="toc">
<h2>Repository Rules</h2>
<ul>
<li><a href="#whl_library">whl_library</a></li>
</ul>
</nav>
<a name="whl_library"></a>
## whl_library
<pre>
whl_library(<a href="#whl_library.name">name</a>, <a href="#whl_library.requirements">requirements</a>, <a href="#whl_library.whl">whl</a>)
</pre>
A rule for importing <code>.whl</code> dependencies into Bazel.
<b>This rule is currently used to implement <code>pip_import</code>,
it is not intended to work standalone, and the interface may change.</b>
See <code>pip_import</code> for proper usage.
This rule imports a <code>.whl</code> file as a <code>py_library</code>:
<pre><code>whl_library(
name = "foo",
whl = ":my-whl-file",
requirements = "name of pip_import rule",
)
</code></pre>
This rule defines a <code>@foo//:pkg</code> <code>py_library</code> target.
<a name="whl_library_args"></a>
### Attributes
<table class="params-table">
<colgroup>
<col class="col-param" />
<col class="col-description" />
</colgroup>
<tbody>
<tr id="whl_library.name">
<td><code>name</code></td>
<td>
<p><code><a href="https://bazel.build/docs/build-ref.html#name">Name</a>; Required</code></p>
<p>A unique name for this rule.</p>
</td>
</tr>
<tr id="whl_library.requirements">
<td><code>requirements</code></td>
<td>
<p><code>String; Optional; Default is ''</code></p>
<p>The name of the pip_import repository rule from which to
load this .whl's dependencies.</p>
</td>
</tr>
<tr id="whl_library.whl">
<td><code>whl</code></td>
<td>
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Required</code></p>
<p>The path to the .whl file (the name is expected to follow <a href="https://www.python.org/dev/peps/pep-0427/#file-name-convention">this
convention</a>)</p>
</td>
</tr>
</tbody>
</table>