Skip to content

Commit 0d203a9

Browse files
authored
docs: split PyPI docs up and add more (#2935)
Summary: - Split the PyPI docs per topic. - Move everything to its own folder. - Separate the `bzlmod` and `WORKSPACE` documentation. Some of the features are only available in `bzlmod` and since `bzlmod` is the future having that as the default makes things a little easier. - Fix a few warnings. Fixes #2810.
1 parent 3464c14 commit 0d203a9

22 files changed

+740
-538
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ to the actual rules_python project and begin the code review process.
6868
## Developer guide
6969

7070
For more more details, guidance, and tips for working with the code base,
71-
see [DEVELOPING.md](DEVELOPING.md)
71+
see [docs/devguide.md](./devguide)
7272

7373
## Formatting
7474

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ dev_pip.parse(
134134
download_only = True,
135135
experimental_index_url = "https://pypi.org/simple",
136136
hub_name = "dev_pip",
137+
parallel_download = False,
137138
python_version = "3.11",
138139
requirements_lock = "//docs:requirements.txt",
139140
)

docs/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ sphinx_stardocs(
120120
"//python/private:rule_builders_bzl",
121121
"//python/private/api:py_common_api_bzl",
122122
"//python/private/pypi:config_settings_bzl",
123+
"//python/private/pypi:env_marker_info_bzl",
123124
"//python/private/pypi:pkg_aliases_bzl",
125+
"//python/private/pypi:whl_config_setting_bzl",
126+
"//python/private/pypi:whl_library_bzl",
124127
"//python/uv:lock_bzl",
125128
"//python/uv:uv_bzl",
126129
"//python/uv:uv_toolchain_bzl",

docs/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@
9191
"api/sphinxdocs/private/sphinx_docs_library": "/api/sphinxdocs/sphinxdocs/private/sphinx_docs_library.html",
9292
"api/sphinxdocs/sphinx_docs_library": "/api/sphinxdocs/sphinxdocs/sphinx_docs_library.html",
9393
"api/sphinxdocs/inventories/index": "/api/sphinxdocs/sphinxdocs/inventories/index.html",
94+
"pip.html": "pypi/index.html",
95+
"pypi-dependencies.html": "pypi/index.html",
9496
}
9597

9698
# Adapted from the template code:
@@ -139,7 +141,9 @@
139141

140142
# --- Extlinks configuration
141143
extlinks = {
144+
"gh-issue": (f"https://github.com/bazel-contrib/rules_python/issues/%s", "#%s issue"),
142145
"gh-path": (f"https://github.com/bazel-contrib/rules_python/tree/main/%s", "%s"),
146+
"gh-pr": (f"https://github.com/bazel-contrib/rules_python/pulls/%s", "#%s PR"),
143147
}
144148

145149
# --- MyST configuration

docs/getting-started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ It assumes you have a `requirements.txt` file with your PyPI dependencies.
88

99
For more details information about configuring `rules_python`, see:
1010
* [Configuring the runtime](configuring-toolchains)
11-
* [Configuring third party dependencies (pip/pypi)](pypi-dependencies)
11+
* [Configuring third party dependencies (pip/pypi)](./pypi/index)
1212
* [API docs](api/index)
1313

14-
## Using bzlmod
14+
## Including dependencies
1515

16-
The first step to using rules_python with bzlmod is to add the dependency to
17-
your MODULE.bazel file:
16+
The first step to using `rules_python` is to add the dependency to
17+
your `MODULE.bazel` file:
1818

1919
```starlark
2020
# Update the version "0.0.0" to the release found here:
@@ -30,7 +30,7 @@ pip.parse(
3030
use_repo(pip, "pypi")
3131
```
3232

33-
## Using a WORKSPACE file
33+
### Using a WORKSPACE file
3434

3535
Using WORKSPACE is deprecated, but still supported, and a bit more involved than
3636
using Bzlmod. Here is a simplified setup to download the prebuilt runtimes.

docs/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ See {gh-path}`Bzlmod support <BZLMOD_SUPPORT.md>` for any behaviour differences
9595
:hidden:
9696
self
9797
getting-started
98-
pypi-dependencies
98+
pypi/index
9999
Toolchains <toolchains>
100-
pip
101100
coverage
102101
precompiling
103102
gazelle

docs/pip.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)