Skip to content

Latest commit

 

History

History
171 lines (141 loc) · 5.24 KB

File metadata and controls

171 lines (141 loc) · 5.24 KB

Import .whl files into Bazel.

Repository Rules

## download_or_build_wheel
download_or_build_wheel(name, buildtime_deps, pip_args, python, requirement, urls, wheel_name)

Attributes

name

Name; Required

A unique name for this rule.

buildtime_deps

List of labels; Optional; Default is []

  </td>
</tr>
<tr id="download_or_build_wheel.pip_args">
  <td><code>pip_args</code></td>
  <td>
    <p><code>List of strings; Optional; Default is []</code></p>
    
  </td>
</tr>
<tr id="download_or_build_wheel.python">
  <td><code>python</code></td>
  <td>
    <p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional</code></p>
    
  </td>
</tr>
<tr id="download_or_build_wheel.requirement">
  <td><code>requirement</code></td>
  <td>
    <p><code>String; Optional; Default is ''</code></p>
    
  </td>
</tr>
<tr id="download_or_build_wheel.urls">
  <td><code>urls</code></td>
  <td>
    <p><code>List of strings; Optional; Default is []</code></p>
    
  </td>
</tr>
<tr id="download_or_build_wheel.wheel_name">
  <td><code>wheel_name</code></td>
  <td>
    <p><code>String; Optional; Default is ''</code></p>
    
  </td>
</tr>
## extract_wheels
extract_wheels(name, additional_runtime_deps, extras, python, remove_runtime_deps, repository, wheels)

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",
    repository = "name of pip_import rule",
)

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

Attributes

name

Name; Required

A unique name for this rule.

additional_runtime_deps

List of strings; Optional; Default is []

  </td>
</tr>
<tr id="extract_wheels.extras">
  <td><code>extras</code></td>
  <td>
    <p><code>List of strings; Optional; Default is []</code></p>
    <p>A subset of the "extras" available from this &lt;code&gt;.whl&lt;/code&gt; for which

<code>requirements</code> has the dependencies.

python

Label; Optional

  </td>
</tr>
<tr id="extract_wheels.remove_runtime_deps">
  <td><code>remove_runtime_deps</code></td>
  <td>
    <p><code>List of strings; Optional; Default is []</code></p>
    
  </td>
</tr>
<tr id="extract_wheels.repository">
  <td><code>repository</code></td>
  <td>
    <p><code>String; Optional; Default is ''</code></p>
    
  </td>
</tr>
<tr id="extract_wheels.wheels">
  <td><code>wheels</code></td>
  <td>
    <p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Optional; Default is []</code></p>
    
  </td>
</tr>