-
-
Notifications
You must be signed in to change notification settings - Fork 577
/
Copy pathMODULE.bazel
61 lines (56 loc) · 1.62 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
module(
name = "multi_python_versions",
)
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_python", version = "0.0.0")
local_path_override(
module_name = "rules_python",
path = "../..",
)
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.defaults(
# The environment variable takes precedence if set.
python_version = "3.9",
python_version_env = "BAZEL_PYTHON_VERSION",
)
python.toolchain(
configure_coverage_tool = True,
# Only set when you have mulitple toolchain versions.
is_default = True,
python_version = "3.9",
)
python.toolchain(
configure_coverage_tool = True,
python_version = "3.10",
)
python.toolchain(
configure_coverage_tool = True,
python_version = "3.11",
)
use_repo(
python,
"pythons_hub",
python = "python_versions",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
use_repo(pip, "pypi")
pip.parse(
hub_name = "pypi",
python_version = "3.9",
requirements_lock = "//requirements:requirements_lock_3_9.txt",
)
pip.parse(
hub_name = "pypi",
python_version = "3.10",
requirements_lock = "//requirements:requirements_lock_3_10.txt",
)
pip.parse(
hub_name = "pypi",
python_version = "3.11",
requirements_lock = "//requirements:requirements_lock_3_11.txt",
)
# example test dependencies
bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True)
# Only needed to make rules_python's CI happy. rules_java 8.3.0+ is needed so
# that --java_runtime_version=remotejdk_11 works with Bazel 8.
bazel_dep(name = "rules_java", version = "8.3.1")