xref: /aosp_15_r20/external/bazelbuild-rules_python/tools/precompiler/BUILD.bazel (revision 60517a1edbc8ecf509223e9af94a7adec7d736b8)
1# Copyright 2017 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
15load("@bazel_skylib//rules:common_settings.bzl", "string_list_flag")
16load("//python/private:py_interpreter_program.bzl", "py_interpreter_program")  # buildifier: disable=bzl-visibility
17
18filegroup(
19    name = "distribution",
20    srcs = glob(["**"]),
21    visibility = ["//:__subpackages__"],
22)
23
24py_interpreter_program(
25    name = "precompiler",
26    execution_requirements = ":execution_requirements",
27    main = "precompiler.py",
28    visibility = [
29        # Not actually public. Only public so rules_python-generated toolchains
30        # are able to reference it.
31        "//visibility:public",
32    ],
33)
34
35string_list_flag(
36    name = "execution_requirements",
37    build_setting_default = [
38        "supports-workers=1",
39        "requires-worker-protocol=json",
40        "supports-multiplex-sandboxing=1",
41        "supports-multiplex-workers=1",
42        "supports-worker-cancellation=1",
43    ],
44)
45