8000 Add output of ./update_docs.sh. · raaaar/rules_python@07785fc · GitHub
[go: up one dir, main page]

Skip to content

Commit 07785fc

Browse files
committed
Add output of ./update_docs.sh.
1 parent bbc6897 commit 07785fc

File tree

6 files changed

+183
-8
lines changed

6 files changed

+183
-8
lines changed

docs/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ <h3>Repository Rules</h3>
9797
<col class="col-description" />
9898
</colgroup>
9999
<tbody>
100+
<tr>
101+
<td>
102+
<a href="./python/pip.html#pip3_import">
103+
<code>pip3_import</code>
104+
</a>
105+
</td>
106+
<td>
107+
<p>A rule for importing &lt;code&gt;requirements.txt&lt;/code&gt; dependencies into Bazel.</p>
108+
109+
</td>
110+
</tr>
100111
<tr>
101112
<td>
102113
<a href="./python/pip.html#pip_import">

docs/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@
4040
<col class="col-description" />
4141
</colgroup>
4242
<tbody>
43+
<tr>
44+
<td>
45+
<a href="./python/pip.html#pip3_import">
46+
<code>pip3_import</code>
47+
</a>
48+
</td>
49+
<td>
50+
<p>A rule for importing &lt;code&gt;requirements.txt&lt;/code&gt; dependencies into Bazel.</p>
51+
52+
</td>
53+
</tr>
4354
<tr>
4455
<td>
4556
<a href="./python/pip.html#pip_import">

docs/python/pip.html

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ <h1>Import pip requirements into Bazel.</h1>
6161
<nav class="toc">
6262
<h2>Repository Rules</h2>
6363
<ul>
64+
<li><a href="#pip3_import">pip3_import</a></li>
6465
<li><a href="#pip_import">pip_import</a></li>
6566
</ul>
6667
<h2>Macros</h2>
@@ -81,14 +82,77 @@ <h2 id="pip_repositories">pip_repositories</h2>
8182

8283
<hr>
8384

85+
<h2 id="pip3_import">pip3_import</h2>
86+
87+
<pre>pip3_import(<a href="#pip3_import.name">name</a>, <a href="#pip3_import.requirements">requirements</a>)</pre>
88+
89+
<p>A rule for importing &lt;code&gt;requirements.txt&lt;/code&gt; dependencies into Bazel.</p>
90+
<p>This rule imports a &lt;code&gt;requirements.txt&lt;/code&gt; file using the system
91+
&lt;code&gt;python3&lt;/code&gt;, and generates a new &lt;code&gt;requirements.bzl&lt;/code&gt; file.
92+
This is used via the &lt;code&gt;WORKSPACE&lt;/code&gt; pattern:</p>
93+
&lt;pre&gt;&lt;code&gt;pip3_import(
94+
name = "foo",
95+
requirements = ":requirements.txt",
96+
)
97+
load("@foo//:requirements.bzl", "pip_install")
98+
pip_install()
99+
&lt;/code&gt;&lt;/pre&gt;<p>You can then reference imported dependencies from your &lt;code&gt;BUILD&lt;/code&gt;
100+
file with:</p>
101+
&lt;pre&gt;&lt;code&gt;load("@foo//:requirements.bzl", "requirement")
102+
py_library(
103+
name = "bar",
104+
...
105+
deps = [
106+
"//my/other:dep",
107+
requirement("futures"),
108+
requirement("mock"),
109+
],
110+
)
111+
&lt;/code&gt;&lt;/pre&gt;<p>Or alternatively:</p>
112+
&lt;pre&gt;&lt;code&gt;load("@foo//:requirements.bzl", "all_requirements")
113+
py_binary(
114+
name = "baz",
115+
...
116+
deps = [
117+
":foo",
118+
] + all_requirements,
119+
)
120+
&lt;/code&gt;&lt;/pre&gt;
121+
122+
<h3 id="pip3_import_args">Attributes</h3>
123+
124+
<table class="params-table">
125+
<colgroup>
126+
<col class="col-param" />
127+
<col class="col-description" />
128+
</colgroup>
129+
<tbody>
130+
<tr id="pip3_import.name">
131+
<td><code>name</code></td>
132+
<td>
133+
<p><code><a href="https://bazel.build/docs/build-ref.html#name">Name</a>; Required</code></p>
134+
<p>A unique name for this rule.</p>
135+
</td>
136+
</tr>
137+
<tr id="pip3_import.requirements">
138+
<td><code>requirements</code></td>
139+
<td>
140+
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Required</code></p>
141+
<p>The label of a requirements.txt file.</p>
142+
</td>
143+
</tr>
144+
</tbody>
145+
</table>
146+
<hr>
147+
84148
<h2 id="pip_import">pip_import</h2>
85149

86150
<pre>pip_import(<a href="#pip_import.name">name</a>, <a href="#pip_import.requirements">requirements</a>)</pre>
87151

88152
<p>A rule for importing &lt;code&gt;requirements.txt&lt;/code&gt; dependencies into Bazel.</p>
89-
<p>This rule imports a &lt;code&gt;requirements.txt&lt;/code&gt; file and generates a new
90-
&lt;code&gt;requirements.bzl&lt;/code&gt; file. This is used via the &lt;code&gt;WORKSPACE&lt;/code&gt;
91-
pattern:</p>
153+
<p>This rule imports a &lt;code&gt;requirements.txt&lt;/code&gt; file using the system
154+
&lt;code&gt;python&lt;/code&gt;, and generates a new &lt;code&gt;requirements.bzl&lt;/code&gt; file.
155+
This is used via the &lt;code&gt;WORKSPACE&lt;/code&gt; pattern:</p>
92156
&lt;pre&gt;&lt;code&gt;pip_import(
93157
name = "foo",
94158
requirements = ":requirements.txt",

docs/python/pip.md

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Documentation generated by Skydoc
88
<nav class="toc">
99
<h2>Repository Rules</h2>
1010
<ul>
11+
<li><a href="#pip3_import">pip3_import</a></li>
1112
<li><a href="#pip_import">pip_import</a></li>
1213
</ul>
1314
<h2>Macros</h2>
@@ -27,6 +28,78 @@ Pull in dependencies needed for pulling in pip dependencies.
2728
A placeholder method that will eventually pull in any dependencies
2829
needed to install pip dependencies.
2930

31+
<a name="pip3_import"></a>
32+
## pip3_import
33+
34+
<pre>
35+
pip3_import(<a href="#pip3_import.name">name</a>, <a href="#pip3_import.requirements">requirements</a>)
36+
</pre>
37+
38+
A rule for importing <code>requirements.txt</code> dependencies into Bazel.
39+
40+
This rule imports a <code>requirements.txt</code> file using the system
41+
<code>python3</code>, and generates a new <code>requirements.bzl</code> file.
42+
This is used via the <code>WORKSPACE</code> pattern:
43+
<pre><code>pip3_import(
44+
name = "foo",
45+
requirements = ":requirements.txt",
46+
)
47+
load("@foo//:requirements.bzl", "pip_install")
48+
pip_install()
49+
</code></pre>
50+
51+
You can then reference imported dependencies from your <code>BUILD</code>
52+
file with:
53+
<pre><code>load("@foo//:requirements.bzl", "requirement")
54+
py_library(
55+
name = "bar",
56+
...
57+
deps = [
58+
"//my/other:dep",
59+
requirement("futures"),
60+
requirement("mock"),
61+
],
62+
)
63+
</code></pre>
64+
65+
Or alternatively:
66+
<pre><code>load("@foo//:requirements.bzl", "all_requirements")
67+
py_binary(
68+
name = "baz",
69+
...
70+
deps = [
71+
":foo",
72+
] + all_requirements,
73+
)
74+
</code></pre>
75+
76+
77+
<a name="pip3_import_args"></a>
78+
### Attributes
79+
80+
81+
<table class="params-table">
82+
<colgroup>
83+
<col class="col-param" />
84+
<col class="col-description" />
85+
</colgroup>
86+
<tbody>
87+
<tr id="pip3_import.name">
88+
<td><code>name</code></td>
89+
<td>
90+
<p><code><a href="https://bazel.build/docs/build-ref.html#name">Name</a>; Required</code></p>
91+
<p>A unique name for this rule.</p>
92+
</td>
93+
</tr>
94+
<tr id="pip3_import.requirements">
95+
<td><code>requirements</code></td>
96+
<td>
97+
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Required</code></p>
98+
<p>The label of a requirements.txt file.</p>
99+
</td>
100+
</tr>
101+
</tbody>
102+
</table>
30103
<a name="pip_import"></a>
31104
## pip_import
32105

@@ -36,9 +109,9 @@ pip_import(<a href="#pip_import.name">name</a>, <a href="#pip_import.requirement
36109

37110
A rule for importing <code>requirements.txt</code> dependencies into Bazel.
38111

39-
This rule imports a <code>requirements.txt</code> file and generates a new
40-
<code>requirements.bzl</code> file. This is used via the <code>WORKSPACE</code>
41-
pattern:
112+
This rule imports a <code>requirements.txt</code> file using the system
113+
<code>python</code>, and generates a new <code>requirements.bzl</code> file.
114+
This is used via the <code>WORKSPACE</code> pattern:
42115
<pre><code>pip_import(
43116
name = "foo",
44117
requirements = ":requirements.txt",

docs/python/whl.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ <h2>Repository Rules</h2>
6868

6969
<h2 id="whl_library">whl_library</h2>
7070

71-
<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>
71+
<pre>whl_library(<a href="#whl_library.name">name</a>, <a href="#whl_library.extras">extras</a>, <a href="#whl_library.requirements">requirements</a>, <a href="#whl_library.whl">whl</a>)</pre>
7272

7373
<p>A rule for importing &lt;code&gt;.whl&lt;/code&gt; dependencies into Bazel.</p>
7474
<p>&lt;b&gt;This rule is currently used to implement &lt;code&gt;pip_import&lt;/code&gt;,
@@ -98,6 +98,14 @@ <h3 id="whl_library_args">Attributes</h3>
9898
<p>A unique name for this rule.</p>
9999
</td>
100100
</tr>
101+
<tr id="whl_library.extras">
102+
<td><code>extras</code></td>
103+
<td>
104+
<p><code>List of strings; Optional; Default is []</code></p>
105+
<p>A subset of the "extras" available from this &lt;code&gt;.whl&lt;/code&gt; for which
106+
&lt;code&gt;requirements&lt;/code&gt; has the dependencies.</p>
107+
</td>
108+
</tr>
101109
<tr id="whl_library.requirements">
102110
<td><code>requirements</code></td>
103111
<td>

docs/python/whl.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Documentation generated by Skydoc
1515
## whl_library
1616

1717
<pre>
18-
whl_library(<a href="#whl_library.name">name</a>, <a href="#whl_library.requirements">requirements</a>, <a href="#whl_library.whl">whl</a>)
18+
whl_library(<a href="#whl_library.name">name</a>, <a href="#whl_library.extras">extras</a>, <a href="#whl_library.requirements">requirements</a>, <a href="#whl_library.whl">whl</a>)
1919
</pre>
2020

2121
A rule for importing <code>.whl</code> dependencies into Bazel.
@@ -52,6 +52,14 @@ This rule defines a <code>@foo//:pkg</code> <code>py_library</code> target.
5252
<p>A unique name for this rule.</p>
5353
</td>
5454
</tr>
55+
<tr id="whl_library.extras">
56+
<td><code>extras</code></td>
57+
<td>
58+
<p><code>List of strings; Optional; Default is []</code></p>
59+
<p>A subset of the "extras" available from this &lt;code&gt;.whl&lt;/code&gt; for which
60+
&lt;code&gt;requirements&lt;/code&gt; has the dependencies.</p>
61+
</td>
62+
</tr>
5563
<tr id="whl_library.requirements">
5664
<td><code>requirements</code></td>
5765
<td>

0 commit comments

Comments
 (0)
0