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