Skip to content

Commit dfab656

Browse files
committed
Fix docstrings, reorder attr, run buildifier, regen docs and tools
1 parent fcf0064 commit dfab656

File tree

6 files changed

+30
-10
lines changed

6 files changed

+30
-10
lines changed

docs/pip.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## pip_import
66

77
<pre>
8-
pip_import(<a href="#pip_import-name">name</a>, <a href="#pip_import-requirements">requirements</a>)
8+
pip_import(<a href="#pip_import-name">name</a>, <a href="#pip_import-python_interpreter">python_interpreter</a>, <a href="#pip_import-requirements">requirements</a>)
99
</pre>
1010

1111
A rule for importing `requirements.txt` dependencies into Bazel.
@@ -67,6 +67,16 @@ py_binary(
6767
</p>
6868
</td>
6969
</tr>
70+
<tr id="pip_import-python_interpreter">
71+
<td><code>python_interpreter</code></td>
72+
<td>
73+
String; optional
74+
<p>
75+
The command to run the Python interpreter used to invoke pip and unpack the
76+
wheels.
77+
</p>
78+
</td>
79+
</tr>
7080
<tr id="pip_import-requirements">
7181
<td><code>requirements</code></td>
7282
<td>

docs/whl.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## whl_library
66

77
<pre>
8-
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>)
8+
whl_library(<a href="#whl_library-name">name</a>, <a href="#whl_library-extras">extras</a>, <a href="#whl_library-python_interpreter">python_interpreter</a>, <a href="#whl_library-requirements">requirements</a>, <a href="#whl_library-whl">whl</a>)
99
</pre>
1010

1111
A rule for importing `.whl` dependencies into Bazel.
@@ -53,6 +53,15 @@ This rule defines `@foo//:pkg` as a `py_library` target.
5353
</p>
5454
</td>
5555
</tr>
56+
<tr id="whl_library-python_interpreter">
57+
<td><code>python_interpreter</code></td>
58+
<td>
59+
String; optional
60+
<p>
61+
The command to run the Python interpreter used when unpacking the wheel.
62+
</p>
63+
</td>
64+
</tr>
5665
<tr id="whl_library-requirements">
5766
<td><code>requirements</code></td>
5867
<td>

packaging/piptool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ def pip_main(argv):
8787
description='Import Python dependencies into Bazel.')
8888

8989
parser.add_argument('--python_interpreter', action='store',
90-
help=('The python python interpreter to use '))
90+
help=('The Python interpreter to use when extracting '
91+
'wheels.'))
9192

9293
parser.add_argument('--name', action='store',
9394
help=('The namespace of the import.'))

python/pip.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ def _pip_import_impl(repository_ctx):
4343

4444
pip_import = repository_rule(
4545
attrs = {
46-
"python_interpreter": attr.string(default="python", doc="""
47-
The command to run the Python interpreter used to invoke pip and unpack the
48-
wheels.
49-
"""),
5046
"requirements": attr.label(
5147
mandatory = True,
5248
allow_single_file = True,
5349
doc = "The label of the requirements.txt file.",
5450
),
51+
"python_interpreter": attr.string(default = "python", doc = """
52+
The command to run the Python interpreter used to invoke pip and unpack the
53+
wheels.
54+
"""),
5555
"_script": attr.label(
5656
executable = True,
5757
default = Label("//tools:piptool.par"),

python/whl.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ A subset of the "extras" available from this <code>.whl</code> for which
4444
"requirements": attr.string(doc = """
4545
The name of the <code>pip_import</code> repository rule from which to load this
4646
<code>.whl</code>'s dependencies.
47-
"""),
48-
"python_interpreter": attr.string(default="python", doc="""
49-
The command to run the Python interpreter used when unpacking the wheel.
5047
"""),
5148
"whl": attr.label(
5249
mandatory = True,
@@ -56,6 +53,9 @@ The path to the <code>.whl</code> file. The name is expected to follow [this
5653
convention](https://www.python.org/dev/peps/pep-0427/#file-name-convention)).
5754
""",
5855
),
56+
"python_interpreter": attr.string(default = "python", doc = """
57+
The command to run the Python interpreter used when unpacking the wheel.
58+
"""),
5959
"_script": attr.label(
6060
executable = True,
6161
default = Label("//tools:whltool.par"),

tools/piptool.par

90 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)