forked from bazelbuild/rules_python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MODULE.bazel
78 lines (70 loc) · 2.3 KB
/
MODULE.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
module(
name = "rules_python",
version = "0.0.0",
compatibility_level = 1,
)
bazel_dep(name = "bazel_features", version = "1.1.1")
bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "platforms", version = "0.0.4")
# Those are loaded only when using py_proto_library
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")
internal_deps = use_extension("@rules_python//python/private/bzlmod:internal_deps.bzl", "internal_deps")
internal_deps.install()
use_repo(
internal_deps,
"rules_python_internal",
# START: maintained by 'bazel run //tools/private:update_pip_deps'
"pypi__build",
"pypi__click",
"pypi__colorama",
"pypi__importlib_metadata",
"pypi__installer",
"pypi__more_itertools",
"pypi__packaging",
"pypi__pep517",
"pypi__pip",
"pypi__pip_tools",
"pypi__pyproject_hooks",
"pypi__setuptools",
"pypi__tomli",
"pypi__wheel",
"pypi__zipp",
# END: maintained by 'bazel run //tools/private:update_pip_deps'
)
# We need to do another use_extension call to expose the "pythons_hub"
# repo.
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
# The default toolchain to use if nobody configures a toolchain.
# NOTE: This is not a stable version. It is provided for convenience, but will
# change frequently to track the most recent Python version.
# NOTE: The root module can override this.
python.toolchain(
is_default = True,
python_version = "3.11",
)
use_repo(python, "pythons_hub")
# This call registers the Python toolchains.
register_toolchains("@pythons_hub//:all")
# ===== DEV ONLY SETUP =====
dev_pip = use_extension(
"//python/extensions:pip.bzl",
"pip",
dev_dependency = True,
)
dev_pip.parse(
experimental_requirement_cycles = {
"sphinx": [
"sphinx",
"sphinxcontrib-serializinghtml",
"sphinxcontrib-qthelp",
"sphinxcontrib-htmlhelp",
"sphinxcontrib-devhelp",
"sphinxcontrib-applehelp",
],
},
hub_name = "dev_pip",
python_version = "3.11",
requirements_lock = "//docs/sphinx:requirements.txt",
)