8000 Migrate from bazelbuild/skydoc to bazelbuild/stardoc (#484) · lapointexavier/rules_python@d95e89f · GitHub
[go: up one dir, main page]

Skip to content

Commit d95e89f

Browse files
author
Jonathon Belotti
authored
Migrate from bazelbuild/skydoc to bazelbuild/stardoc (bazel-contrib#484)
1 parent bccb3c5 commit d95e89f

File tree

7 files changed

+187
-534
lines changed

7 files changed

+187
-534
lines changed

docs/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
###############################################################################
1818

1919
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
20-
load("@io_bazel_skydoc//stardoc:stardoc.bzl", "stardoc")
20+
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
2121

2222
package(default_visibility = ["//visibility:public"])
2323

docs/packaging.md

Lines changed: 35 additions & 243 deletions
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,24 @@ belong to given set of Python packages.
1414
This rule is intended to be used as data dependency to py_wheel rule
1515

1616

17-
### Attributes
17+
**ATTRIBUTES**
1818

19-
<table class="params-table">
20-
<colgroup>
21-
<col class="col-param" />
22-
<col class="col-description" />
23-
</colgroup>
24-
<tbody>
25-
<tr id="py_package-name">
26-
<td><code>name</code></td>
27-
<td>
28-
<a href="https://bazel.build/docs/build-ref.html#name">Name</a>; required
29-
<p>
30-
A unique name for this target.
31-
</p>
32-
</td>
33-
</tr>
34-
<tr id="py_package-deps">
35-
<td><code>deps</code></td>
36-
<td>
37-
<a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a>; optional
38-
</td>
39-
</tr>
40-
<tr id="py_package-packages">
41-
<td><code>packages</code></td>
42-
<td>
43-
List of strings; optional
44-
<p>
45-
List of Python packages to include in the distribution.
46-
Sub-packages are automatically included.
47-
</p>
48-
</td>
49-
</tr>
50-
</tbody>
51-
</table>
19+
20+
| Name | Description | Type | Mandatory | Default |
21+
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
22+
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
23+
| deps | - | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
24+
| packages | List of Python packages to include in the distribution. Sub-packages are automatically included. | List of strings | optional | [] |
5225

5326

5427
<a name="#py_wheel"></a>
5528

5629
## py_wheel
5730

5831
<pre>
59-
py_wheel(<a href="#py_wheel-name">name</a>, <a href="#py_wheel-abi">abi</a>, <a href="#py_wheel-author">author</a>, <a href="#py_wheel-author_email">author_email</a>, <a href="#py_wheel-classifiers">classifiers</a>, <a href="#py_wheel-console_scripts">console_scripts</a>, <a href="#py_wheel-deps">deps</a>, <a href="#py_wheel-description_file">description_file</a>, <a href="#py_wheel-distribution">distribution</a>, <a href="#py_wheel-entry_points">entry_points</a>, <a href="#py_wheel-extra_requires">extra_requires</a>, <a href="#py_wheel-homepage">homepage</a>, <a href="#py_wheel-license">license</a>, <a href="#py_wheel-platform">platform</a>, <a href="#py_wheel-python_requires">python_requires</a>, <a href="#py_wheel-python_tag">python_tag</a>, <a href="#py_wheel-requires">requires</a>, <a href="#py_wheel-strip_path_prefixes">strip_path_prefixes</a>, <a href="#py_wheel-version">version</a>)
32+
py_wheel(<a href="#py_wheel-name">name</a>, <a href="#py_wheel-abi">abi</a>, <a href="#py_wheel-author">author</a>, <a href="#py_wheel-author_email">author_email</a>, <a href="#py_wheel-classifiers">classifiers</a>, <a href="#py_wheel-console_scripts">console_scripts</a>, <a href="#py_wheel-deps">deps</a>, <a href="#py_wheel-description_file">description_file</a>,
33+
<a href="#py_wheel-distribution">distribution</a>, <a href="#py_wheel-entry_points">entry_points</a>, <a href="#py_wheel-extra_requires">extra_requires</a>, <a href="#py_wheel-homepage">homepage</a>, <a href="#py_wheel-license">license</a>, <a href="#py_wheel-platform">platform</a>, <a href="#py_wheel-python_requires">python_requires</a>,
34+
<a href="#py_wheel-python_tag">python_tag</a>, <a href="#py_wheel-requires">requires</a>, <a href="#py_wheel-strip_path_prefixes">strip_path_prefixes</a>, <a href="#py_wheel-version">version</a>)
6035
</pre>
6136

6237

@@ -71,7 +46,7 @@ Currently only pure-python wheels are supported.
7146
Examples:
7247

7348
```python
74-
# Package just a specific py_libraries, without their dependencies
49+
# Package some specific py_library targets, without their dependencies
7550
py_wheel(
7651
name = "minimal_with_py_library",
7752
# Package data. We're building "example_minimal_library-0.0.1-py3-none-any.whl"
@@ -104,212 +79,29 @@ py_wheel(
10479
```
10580

10681

107-
### Attributes
108-
109-
<table class="params-table">
110-
<colgroup>
111-
<col class="col-param" />
112-
<col class="col-description" />
113-
</colgroup>
114-
<tbody>
115-
<tr id="py_wheel-name">
116-
<td><code>name</code></td>
117-
<td>
118-
<a href="https://bazel.build/docs/build-ref.html#name">Name</a>; required
119-
<p>
120-
A unique name for this target.
121-
</p>
122-
</td>
123-
</tr>
124-
<tr id="py_wheel-abi">
125-
<td><code>abi</code></td>
126-
<td>
127-
String; optional
128-
<p>
129-
Python ABI tag. 'none' for pure-Python wheels.
130-
</p>
131-
</td>
132-
</tr>
133-
<tr id="py_wheel-author">
134-
<td><code>author</code></td>
135-
<td>
136-
String; optional
137-
<p>
138-
A string specifying the author of the package.
139-
</p>
140-
</td>
141-
</tr>
142-
<tr id="py_wheel-author_email">
143-
<td><code>author_email</code></td>
144-
<td>
145-
String; optional
146-
<p>
147-
A string specifying the email address of the package author.
148-
</p>
149-
</td>
150-
</tr>
151-
<tr id="py_wheel-classifiers">
152-
<td><code>classifiers</code></td>
153-
<td>
154-
List of strings; optional
155-
<p>
156-
A list of strings describing the categories for the package.
157-
</p>
158-
</td>
159-
</tr>
160-
<tr id="py_wheel-console_scripts">
161-
<td><code>console_scripts</code></td>
162-
<td>
163-
<a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a>; optional
164-
<p>
165-
Deprecated console_script entry points, e.g. `{'main': 'examples.wheel.main:main'}`.
166-
167-
Deprecated: prefer the `entry_points` attribute, which supports `console_scripts` as well as other entry points.
168-
</p>
169-
</td>
170-
</tr>
171-
<tr id="py_wheel-deps">
172-
<td><code>deps</code></td>
173-
<td>
174-
<a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a>; optional
175-
<p>
176-
Targets to be included in the distribution.
177-
178-
The targets to package are usually `py_library` rules or filesets (for packaging data files).
179-
180-
Note it's usually better to package `py_library` targets and use
181-
`entry_points` attribute to specify `console_scripts` than to package
182-
`py_binary` rules. `py_binary` targets would wrap a executable script that
183-
tries to locate `.runfiles` directory which is not packaged in the wheel.
184-
</p>
185-
</td>
186-
</tr>
187-
<tr id="py_wheel-description_file">
188-
<td><code>description_file</code></td>
189-
<td>
190-
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
191-
<p>
192-
A file containing text describing the package in a single line.
193-
</p>
194-
</td>
195-
</tr>
196-
<tr id="py_wheel-distribution">
197-
<td><code>distribution</code></td>
198-
<td>
199-
String; required
200-
<p>
201-
Name of the distribution.
202-
203-
This should match the project name onm PyPI. It's also the name that is used to
204-
refer to the package in other packages' dependencies.
205-
</p>
206-
</td>
207-
</tr>
208-
<tr id="py_wheel-entry_points">
209-
<td><code>entry_points</code></td>
210-
<td>
211-
<a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> List of strings</a>; optional
212-
<p>
213-
entry_points, e.g. `{'console_scripts': ['main = examples.wheel.main:main']}`.
214-
</p>
215-
</td>
216-
</tr>
217-
<tr id="py_wheel-extra_requires">
218-
<td><code>extra_requires</code></td>
219-
<td>
220-
<a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> List of strings</a>; optional
221-
<p>
222-
List of optional requirements for this package
223-
</p>
224-
</td>
225-
</tr>
226-
<tr id="py_wheel-homepage">
227-
<td><code>homepage</code></td>
228-
<td>
229-
String; optional
230-
<p>
231-
A string specifying the URL for the package homepage.
232-
</p>
233-
</td>
234-
</tr>
235-
<tr id="py_wheel-license">
236-
<td><code>license</code></td>
237-
<td>
238-
String; optional
239-
<p>
240-
A string specifying the license of the package.
241-
</p>
242-
</td>
243-
</tr>
244-
<tr id="py_wheel-platform">
245-
<td><code>platform</code></td>
246-
<td>
247-
String; optional
248-
<p>
249-
Supported platform. Use 'any' for pure-Python wheel.
250-
251-
If you have included platform-specific data, such as a .pyd or .so
252-
extension module, you will need to specify the platform in standard
253-
pip format. If you support multiple platforms, you can define
254-
platform constraints, then use a select() to specify the appropriate
255-
specifier, eg:
256-
257-
<code>
258-
platform = select({
259-
"//platforms:windows_x86_64": "win_amd64",
260-
"//platforms:macos_x86_64": "macosx_10_7_x86_64",
261-
"//platforms:linux_x86_64": "manylinux2014_x86_64",
262-
})
263-
</code>
264-
</p>
265-
</td>
266-
</tr>
267-
<tr id="py_wheel-python_requires">
268-
<td><code>python_requires</code></td>
269-
<td>
270-
String; optional
271-
<p>
272-
A string specifying what other distributions need to be installed when this one is. See the section on [Declaring required dependency](https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#declaring-dependencies) for details and examples of the format of this argument.
273-
</p>
274-
</td>
275-
</tr>
276-
<tr id="py_wheel-python_tag">
277-
<td><code>python_tag</code></td>
278-
<td>
279-
String; optional
280-
<p>
281-
Supported Python version(s), eg `py3`, `cp35.cp36`, etc
282-
</p>
283-
</td>
284-
</tr>
285-
<tr id="py_wheel-requires">
286-
<td><code>requires</code></td>
287-
<td>
288-
List of strings; optional
289-
<p>
290-
List of requirements for this package
291-
</p>
292-
</td>
293-
</tr>
294-
<tr id="py_wheel-strip_path_prefixes">
295-
<td><code>strip_path_prefixes</code></td>
296-
<td>
297-
List of strings; optional
298-
<p>
299-
path prefixes to strip from files added to the generated package
300-
</p>
301-
</td>
302-
</tr>
303-
<tr id="py_wheel-version">
304-
<td><code>version</code></td>
305-
<td>
306-
String; required
307-
<p>
308-
Version number of the package
309-
</p>
310-
</td>
311-
</tr>
312-
</tbody>
313-
</table>
82+
**ATTRIBUTES**
83+
84+
85+
| Name | Description | Type | Mandatory | Default |
86+
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
87+
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
88+
| abi | Python ABI tag. 'none' for pure-Python wheels. | String | optional | "none" |
89+
| author | A string specifying the author of the package. | String | optional | "" |
90+
| author_email | A string specifying the email address of the package author. | String | optional | "" |
91+
| classifiers | A list of strings describing the categories for the package. For valid classifiers see https://pypi.org/classifiers | List of strings | optional | [] |
92+
| console_scripts | Deprecated console_script entry points, e.g. <code>{'main': 'examples.wheel.main:main'}</code>.<br><br>Deprecated: prefer the <code>entry_points</code> attribute, which supports <code>console_scripts</code> as well as other entry points. | <a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a> | optional | {} |
93+
| deps | Targets to be included in the distribution.<br><br>The targets to package are usually <code>py_library</code> rules or filesets (for packaging data files).<br><br>Note it's usually better to package <code>py_library</code> targets and use <code>entry_points</code> attribute to specify <code>console_scripts</code> than to package <code>py_binary</code> rules. <code>py_binary</code> targets would wrap a executable script that tries to locate <code>.runfiles</code> directory which is not packaged in the wheel. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
94+
| description_file | A file containing text describing the package in a single line. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | None |
95+
| distribution | Name of the distribution.<br><br>This should match the project name onm PyPI. It's also the name that is used to refer to the package in other packages' dependencies. | String | required | |
96+
| entry_points | entry_points, e.g. <code>{'console_scripts': ['main = examples.wheel.main:main']}</code>. | <a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> List of strings</a> | optional | {} |
97+
| extra_requires | List of optional requirements for this package | <a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> List of strings</a> | optional | {} |
98+
| homepage | A string specifying the URL for the package homepage. | String | optional | "" |
99+
| license | A string specifying the license of the package. | String | optional | "" |
100+
| platform | Supported platform. Use 'any' for pure-Python wheel.<br><br>If you have included platform-specific data, such as a .pyd or .so extension module, you will need to specify the platform in standard pip format. If you support multiple platforms, you can define platform constraints, then use a select() to specify the appropriate specifier, eg:<br><br>&lt;code&gt; platform = select({ "//platforms:windows_x86_64": "win_amd64", "//platforms:macos_x86_64": "macosx_10_7_x86_64", "//platforms:linux_x86_64": "manylinux2014_x86_64", }) &lt;/code&gt; | String | optional | "any" |
101+
| python_requires | A string specifying what other distributions need to be installed when this one is. See the section on [Declaring required dependency](https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#declaring-dependencies) for details and examples of the format of this argument. | String | optional | "" |
102+
| python_tag | Supported Python version(s), eg <code>py3</code>, <code>cp35.cp36</code>, etc | String | optional | "py3" |
103+
| requires | List of requirements for this package | List of strings | optional | [] |
104+
| strip_path_prefixes | path prefixes to strip from files added to the generated package | List of strings | optional | [] |
105+
| version | Version number of the package | String | required | |
314106

315107

0 commit comments

Comments
 (0)
0