xref: /aosp_15_r20/external/bazelbuild-rules_python/examples/pip_parse/MODULE.bazel (revision 60517a1edbc8ecf509223e9af94a7adec7d736b8)
1module(name = "rules_python_pip_parse_example")
2
3bazel_dep(name = "rules_python", version = "0.0.0")
4local_path_override(
5    module_name = "rules_python",
6    path = "../..",
7)
8
9python = use_extension("@rules_python//python/extensions:python.bzl", "python")
10python.toolchain(
11    # We can specify the exact version.
12    python_version = "3.9.13",
13)
14
15# You can use this repo mapping to ensure that your BUILD.bazel files don't need
16# to be updated when the python version changes to a different `3.9` version.
17use_repo(
18    python,
19    python_3_9 = "python_3_9_13",
20)
21
22pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
23pip.parse(
24    download_only = True,
25    experimental_requirement_cycles = {
26        "sphinx": [
27            "sphinx",
28            "sphinxcontrib-serializinghtml",
29            "sphinxcontrib-qthelp",
30            "sphinxcontrib-htmlhelp",
31            "sphinxcontrib-devhelp",
32            "sphinxcontrib-applehelp",
33        ],
34    },
35    hub_name = "pypi",
36    # We need to use the same version here as in the `python.toolchain` call.
37    python_version = "3.9.13",
38    requirements_lock = "//:requirements_lock.txt",
39    requirements_windows = "//:requirements_windows.txt",
40)
41use_repo(pip, "pypi")
42