• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2022 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#    http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15"""WORKSPACE setup for development and testing of rules_python itself."""
16
17load("@bazel_features//:deps.bzl", "bazel_features_deps")
18load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
19load("@cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies")
20load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
21load("@rules_bazel_integration_test//bazel_integration_test:deps.bzl", "bazel_integration_test_rules_dependencies")
22load("@rules_bazel_integration_test//bazel_integration_test:repo_defs.bzl", "bazel_binaries")
23load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
24load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
25load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")
26load("//:version.bzl", "SUPPORTED_BAZEL_VERSIONS")
27load("//python:versions.bzl", "MINOR_MAPPING", "TOOL_VERSIONS")
28load("//python/private:internal_config_repo.bzl", "internal_config_repo")  # buildifier: disable=bzl-visibility
29load("//python/private:pythons_hub.bzl", "hub_repo")  # buildifier: disable=bzl-visibility
30load("//python/private/pypi:deps.bzl", "pypi_deps")  # buildifier: disable=bzl-visibility
31
32def rules_python_internal_setup():
33    """Setup for development and testing of rules_python itself."""
34
35    internal_config_repo(name = "rules_python_internal")
36    hub_repo(
37        name = "pythons_hub",
38        minor_mapping = MINOR_MAPPING,
39        default_python_version = "",
40        toolchain_prefixes = [],
41        toolchain_python_versions = [],
42        toolchain_set_python_version_constraints = [],
43        toolchain_user_repository_names = [],
44        python_versions = sorted(TOOL_VERSIONS.keys()),
45    )
46
47    pypi_deps()
48
49    bazel_skylib_workspace()
50
51    rules_proto_dependencies()
52    rules_proto_toolchains()
53
54    protobuf_deps()
55
56    rules_java_dependencies()
57    rules_java_toolchains()
58
59    bazel_integration_test_rules_dependencies()
60    bazel_starlib_dependencies()
61    bazel_binaries(versions = SUPPORTED_BAZEL_VERSIONS)
62    bazel_features_deps()
63    rules_shell_dependencies()
64    rules_shell_toolchains()
65