Skip to content

Commit 79fa370

Browse files
committed
cleanup docs and example WORKSPACE files
1 parent cb47691 commit 79fa370

4 files changed

Lines changed: 1 addition & 239 deletions

File tree

docs/pypi/download-workspace.md

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

docs/pypi/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Using PyPI packages (aka "pip install") involves the following main steps:
88

99
1. [Generating requirements file](./lock)
10-
2. Installing third-party packages in [bzlmod](./download) or [WORKSPACE](./download-workspace).
10+
2. Installing third-party packages in [bzlmod](./download).
1111
3. [Using third-party packages as dependencies](./use)
1212

1313
With the advanced topics covered separately:
@@ -17,7 +17,6 @@ With the advanced topics covered separately:
1717
```{toctree}
1818
lock
1919
download
20-
download-workspace
2120
use
2221
```
2322

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +0,0 @@
1-
workspace(name = "rules_python_multi_python_versions")
2-
3-
local_repository(
4-
name = "rules_python",
5-
path = "../..",
6-
)
7-
8-
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_multi_toolchains")
9-
10-
py_repositories()
11-
12-
default_python_version = "3.10"
13-
14-
python_register_multi_toolchains(
15-
name = "python",
16-
default_version = default_python_version,
17-
python_versions = [
18-
"3.10",
19-
"3.11",
20-
"3.12",
21-
"3.13",
22-
"3.14",
23-
],
24-
register_coverage_tool = True,
25-
)
26-
27-
load("@python//:pip.bzl", "multi_pip_parse")
28-
29-
multi_pip_parse(
30-
name = "pypi",
31-
default_version = default_python_version,
32-
python_interpreter_target = {
33-
"3.10": "@python_3_10_host//:python",
34-
"3.11": "@python_3_11_host//:python",
35-
"3.12": "@python_3_12_host//:python",
36-
"3.13": "@python_3_13_host//:python",
37-
"3.14": "@python_3_14_host//:python",
38-
},
39-
requirements_lock = {
40-
"3.10": "//requirements:requirements_lock_3_10.txt",
41-
"3.11": "//requirements:requirements_lock_3_11.txt",
42-
"3.12": "//requirements:requirements_lock_3_12.txt",
43-
"3.13": "//requirements:requirements_lock_3_13.txt",
44-
"3.14": "//requirements:requirements_lock_3_14.txt",
45-
},
46-
)
47-
48-
load("@pypi//:requirements.bzl", "install_deps")
49-
50-
install_deps()
51-
52-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
53-
54-
# See https://github.com/bazelbuild/rules_shell/releases/tag/v0.2.0
55-
http_archive(
56-
name = "rules_shell",
57-
sha256 = "410e8ff32e018b9efd2743507e7595c26e2628567c42224411ff533b57d27c28",
58-
strip_prefix = "rules_shell-0.2.0",
59-
url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.2.0/rules_shell-v0.2.0.tar.gz",
60-
)
61-
62-
load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")
63-
64-
rules_shell_dependencies()
65-
66-
rules_shell_toolchains()

examples/pip_parse/WORKSPACE

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +0,0 @@
1-
workspace(name = "rules_python_pip_parse_example")
2-
3-
local_repository(
4-
name = "rules_python",
5-
path = "../..",
6-
)
7-
8-
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
9-
10-
py_repositories()
11-
12-
python_register_toolchains(
13-
name = "python_3_9",
14-
python_version = "3.9.25",
15-
)
16-
17-
load("@rules_python//python:pip.bzl", "pip_parse")
18-
19-
pip_parse(
20-
# (Optional) You can set an environment in the pip process to control its
21-
# behavior. Note that pip is run in "isolated" mode so no PIP_<VAR>_<NAME>
22-
# style env vars are read, but env vars that control requests and urllib3
23-
# can be passed
24-
# environment = {"HTTPS_PROXY": "http://my.proxy.fun/"},
25-
name = "pypi",
26-
27-
# Requirement groups allow Bazel to tolerate PyPi cycles by putting dependencies
28-
# which are known to form cycles into groups together.
29-
experimental_requirement_cycles = {
30-
"sphinx": [
31-
"sphinx",
32-
"sphinxcontrib-qthelp",
33-
"sphinxcontrib-htmlhelp",
34-
"sphinxcontrib-devhelp",
35-
"sphinxcontrib-applehelp",
36-
"sphinxcontrib-serializinghtml",
37-
],
38-
},
39-
# (Optional) You can provide extra parameters to pip.
40-
# Here, make pip output verbose (this is usable with `quiet = False`).
41-
# extra_pip_args = ["-v"],
42-
43-
# (Optional) You can exclude custom elements in the data section of the generated BUILD files for pip packages.
44-
# Exclude directories with spaces in their names in this example (avoids build errors if there are such directories).
45-
#pip_data_exclude = ["**/* */**"],
46-
47-
# (Optional) You can provide a python_interpreter (path) or a python_interpreter_target (a Bazel target, that
48-
# acts as an executable). The latter can be anything that could be used as Python interpreter. E.g.:
49-
# 1. Python interpreter that you compile in the build file (as above in @python_interpreter).
50-
# 2. Pre-compiled python interpreter included with http_archive
51-
# 3. Wrapper script, like in the autodetecting python toolchain.
52-
#
53-
# Here, we use the interpreter constant that resolves to the host interpreter from the default Python toolchain.
54-
python_interpreter_target = "@python_3_9_host//:python",
55-
56-
# (Optional) You can set quiet to False if you want to see pip output.
57-
#quiet = False,
58-
requirements_lock = "//:requirements_lock.txt",
59-
requirements_windows = "//:requirements_windows.txt",
60-
)
61-
62-
load("@pypi//:requirements.bzl", "install_deps")
63-
64-
# Initialize repositories for all packages in requirements_lock.txt.
65-
install_deps()

0 commit comments

Comments
 (0)