-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMODULE.bazel
More file actions
87 lines (74 loc) · 2.45 KB
/
MODULE.bazel
File metadata and controls
87 lines (74 loc) · 2.45 KB
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
79
80
81
82
83
84
85
86
87
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
module(
name = "bazel_tools_python_test",
version = "0.0.0",
compatibility_level = 1,
)
##########################
# Internal dependencies. #
##########################
bazel_dep(name = "rules_python", version = "1.4.1")
######################################
# Python toolchain and dependencies. #
######################################
PYTHON_VERSIONS = [
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
]
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
[
python.toolchain(
configure_coverage_tool = True,
ignore_root_user_error = True,
is_default = False,
python_version = "{}".format(version),
)
for version in PYTHON_VERSIONS
]
# We can't use a loop for the following `use_repo` because we change the name of each toolchain.
# buildifier: leave-alone
use_repo(
python,
test_python_3_8 = "python_3_8",
test_python_3_9 = "python_3_9",
test_python_3_10 = "python_3_10",
test_python_3_11 = "python_3_11",
test_python_3_12 = "python_3_12",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
[
pip.parse(
hub_name = "test_pip_{}".format(version.replace(".", "_")),
python_version = "{}".format(version),
requirements_lock = "//pip:requirements_lock_{}.txt".format(version.replace(".", "_")),
)
for version in PYTHON_VERSIONS
]
[
use_repo(pip, "test_pip_{}".format(version.replace(".", "_")))
for version in PYTHON_VERSIONS
]
rules_python_pip_hub = use_extension("//pip:extensions.bzl", "rules_python_pip_hub")
use_repo(rules_python_pip_hub, "test_pip_hub")
###########################
# Dependencies from bazel_tools_python. #
###########################
bazel_dep(name = "score_bazel_tools_python", version = "0.1.3", repo_name = "bazel_tools_python")
local_path_override(
module_name = "score_bazel_tools_python",
path = "..",
)