xref: /aosp_15_r20/external/bazelbuild-rules_python/tools/private/update_deps/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.
14load("//python:py_binary.bzl", "py_binary")
15load("//python:py_library.bzl", "py_library")
16load("//python:py_test.bzl", "py_test")
17
18licenses(["notice"])
19
20py_library(
21    name = "args",
22    srcs = ["args.py"],
23    imports = ["../../.."],
24    deps = ["//python/runfiles"],
25)
26
27py_library(
28    name = "update_file",
29    srcs = ["update_file.py"],
30    imports = ["../../.."],
31)
32
33py_binary(
34    name = "update_coverage_deps",
35    srcs = ["update_coverage_deps.py"],
36    data = [
37        "//python/private:coverage_deps",
38    ],
39    env = {
40        "UPDATE_FILE": "$(rlocationpath //python/private:coverage_deps)",
41    },
42    imports = ["../../.."],
43    deps = [
44        ":args",
45        ":update_file",
46    ],
47)
48
49py_binary(
50    name = "update_pip_deps",
51    srcs = ["update_pip_deps.py"],
52    data = [
53        "//python/private/pypi:deps.bzl",
54        "//python/private/pypi:requirements_txt",
55    ],
56    env = {
57        "DEPS_BZL": "$(rlocationpath //python/private/pypi:deps.bzl)",
58        "REQUIREMENTS_TXT": "$(rlocationpath //python/private/pypi:requirements_txt)",
59    },
60    imports = ["../../.."],
61    deps = [
62        ":args",
63        ":update_file",
64    ],
65)
66
67py_test(
68    name = "update_file_test",
69    srcs = ["update_file_test.py"],
70    imports = ["../../.."],
71    deps = [
72        ":update_file",
73    ],
74)
75