xref: /aosp_15_r20/external/bazelbuild-rules_python/internal_setup.bzl (revision 60517a1edbc8ecf509223e9af94a7adec7d736b8)
1*60517a1eSAndroid Build Coastguard Worker# Copyright 2022 The Bazel Authors. All rights reserved.
2*60517a1eSAndroid Build Coastguard Worker#
3*60517a1eSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
4*60517a1eSAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
5*60517a1eSAndroid Build Coastguard Worker# You may obtain a copy of the License at
6*60517a1eSAndroid Build Coastguard Worker#
7*60517a1eSAndroid Build Coastguard Worker#    http://www.apache.org/licenses/LICENSE-2.0
8*60517a1eSAndroid Build Coastguard Worker#
9*60517a1eSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*60517a1eSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
11*60517a1eSAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*60517a1eSAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
13*60517a1eSAndroid Build Coastguard Worker# limitations under the License.
14*60517a1eSAndroid Build Coastguard Worker
15*60517a1eSAndroid Build Coastguard Worker"""Setup for rules_python tests and tools."""
16*60517a1eSAndroid Build Coastguard Worker
17*60517a1eSAndroid Build Coastguard Workerload("@bazel_features//:deps.bzl", "bazel_features_deps")
18*60517a1eSAndroid Build Coastguard Workerload("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
19*60517a1eSAndroid Build Coastguard Workerload("@cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies")
20*60517a1eSAndroid Build Coastguard Workerload("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
21*60517a1eSAndroid Build Coastguard Workerload("@rules_bazel_integration_test//bazel_integration_test:deps.bzl", "bazel_integration_test_rules_dependencies")
22*60517a1eSAndroid Build Coastguard Workerload("@rules_bazel_integration_test//bazel_integration_test:repo_defs.bzl", "bazel_binaries")
23*60517a1eSAndroid Build Coastguard Workerload("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
24*60517a1eSAndroid Build Coastguard Workerload("//:version.bzl", "SUPPORTED_BAZEL_VERSIONS")
25*60517a1eSAndroid Build Coastguard Workerload("//python/private:internal_config_repo.bzl", "internal_config_repo")  # buildifier: disable=bzl-visibility
26*60517a1eSAndroid Build Coastguard Workerload("//python/private/pypi:deps.bzl", "pypi_deps")  # buildifier: disable=bzl-visibility
27*60517a1eSAndroid Build Coastguard Worker
28*60517a1eSAndroid Build Coastguard Workerdef rules_python_internal_setup():
29*60517a1eSAndroid Build Coastguard Worker    """Setup for rules_python tests and tools."""
30*60517a1eSAndroid Build Coastguard Worker
31*60517a1eSAndroid Build Coastguard Worker    internal_config_repo(name = "rules_python_internal")
32*60517a1eSAndroid Build Coastguard Worker
33*60517a1eSAndroid Build Coastguard Worker    # Because we don't use the pip_install rule, we have to call this to fetch its deps
34*60517a1eSAndroid Build Coastguard Worker    pypi_deps()
35*60517a1eSAndroid Build Coastguard Worker
36*60517a1eSAndroid Build Coastguard Worker    bazel_skylib_workspace()
37*60517a1eSAndroid Build Coastguard Worker
38*60517a1eSAndroid Build Coastguard Worker    rules_proto_dependencies()
39*60517a1eSAndroid Build Coastguard Worker    rules_proto_toolchains()
40*60517a1eSAndroid Build Coastguard Worker
41*60517a1eSAndroid Build Coastguard Worker    protobuf_deps()
42*60517a1eSAndroid Build Coastguard Worker
43*60517a1eSAndroid Build Coastguard Worker    bazel_integration_test_rules_dependencies()
44*60517a1eSAndroid Build Coastguard Worker    bazel_starlib_dependencies()
45*60517a1eSAndroid Build Coastguard Worker    bazel_binaries(versions = SUPPORTED_BAZEL_VERSIONS)
46*60517a1eSAndroid Build Coastguard Worker    bazel_features_deps()
47