xref: /aosp_15_r20/external/bazelbuild-rules_python/python/private/pypi/deps.bzl (revision 60517a1edbc8ecf509223e9af94a7adec7d736b8)
1*60517a1eSAndroid Build Coastguard Worker# Copyright 2023 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""
16*60517a1eSAndroid Build Coastguard Worker
17*60517a1eSAndroid Build Coastguard Workerload("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
18*60517a1eSAndroid Build Coastguard Workerload("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
19*60517a1eSAndroid Build Coastguard Worker
20*60517a1eSAndroid Build Coastguard Worker_RULE_DEPS = [
21*60517a1eSAndroid Build Coastguard Worker    # START: maintained by 'bazel run //tools/private/update_deps:update_pip_deps'
22*60517a1eSAndroid Build Coastguard Worker    (
23*60517a1eSAndroid Build Coastguard Worker        "pypi__build",
24*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/e2/03/f3c8ba0a6b6e30d7d18c40faab90807c9bb5e9a1e3b2fe2008af624a9c97/build-1.2.1-py3-none-any.whl",
25*60517a1eSAndroid Build Coastguard Worker        "75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4",
26*60517a1eSAndroid Build Coastguard Worker    ),
27*60517a1eSAndroid Build Coastguard Worker    (
28*60517a1eSAndroid Build Coastguard Worker        "pypi__click",
29*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl",
30*60517a1eSAndroid Build Coastguard Worker        "ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28",
31*60517a1eSAndroid Build Coastguard Worker    ),
32*60517a1eSAndroid Build Coastguard Worker    (
33*60517a1eSAndroid Build Coastguard Worker        "pypi__colorama",
34*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl",
35*60517a1eSAndroid Build Coastguard Worker        "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6",
36*60517a1eSAndroid Build Coastguard Worker    ),
37*60517a1eSAndroid Build Coastguard Worker    (
38*60517a1eSAndroid Build Coastguard Worker        "pypi__importlib_metadata",
39*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl",
40*60517a1eSAndroid Build Coastguard Worker        "30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570",
41*60517a1eSAndroid Build Coastguard Worker    ),
42*60517a1eSAndroid Build Coastguard Worker    (
43*60517a1eSAndroid Build Coastguard Worker        "pypi__installer",
44*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/e5/ca/1172b6638d52f2d6caa2dd262ec4c811ba59eee96d54a7701930726bce18/installer-0.7.0-py3-none-any.whl",
45*60517a1eSAndroid Build Coastguard Worker        "05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53",
46*60517a1eSAndroid Build Coastguard Worker    ),
47*60517a1eSAndroid Build Coastguard Worker    (
48*60517a1eSAndroid Build Coastguard Worker        "pypi__more_itertools",
49*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl",
50*60517a1eSAndroid Build Coastguard Worker        "686b06abe565edfab151cb8fd385a05651e1fdf8f0a14191e4439283421f8684",
51*60517a1eSAndroid Build Coastguard Worker    ),
52*60517a1eSAndroid Build Coastguard Worker    (
53*60517a1eSAndroid Build Coastguard Worker        "pypi__packaging",
54*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl",
55*60517a1eSAndroid Build Coastguard Worker        "2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5",
56*60517a1eSAndroid Build Coastguard Worker    ),
57*60517a1eSAndroid Build Coastguard Worker    (
58*60517a1eSAndroid Build Coastguard Worker        "pypi__pep517",
59*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/25/6e/ca4a5434eb0e502210f591b97537d322546e4833dcb4d470a48c375c5540/pep517-0.13.1-py3-none-any.whl",
60*60517a1eSAndroid Build Coastguard Worker        "31b206f67165b3536dd577c5c3f1518e8fbaf38cbc57efff8369a392feff1721",
61*60517a1eSAndroid Build Coastguard Worker    ),
62*60517a1eSAndroid Build Coastguard Worker    (
63*60517a1eSAndroid Build Coastguard Worker        "pypi__pip",
64*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl",
65*60517a1eSAndroid Build Coastguard Worker        "ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc",
66*60517a1eSAndroid Build Coastguard Worker    ),
67*60517a1eSAndroid Build Coastguard Worker    (
68*60517a1eSAndroid Build Coastguard Worker        "pypi__pip_tools",
69*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/0d/dc/38f4ce065e92c66f058ea7a368a9c5de4e702272b479c0992059f7693941/pip_tools-7.4.1-py3-none-any.whl",
70*60517a1eSAndroid Build Coastguard Worker        "4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9",
71*60517a1eSAndroid Build Coastguard Worker    ),
72*60517a1eSAndroid Build Coastguard Worker    (
73*60517a1eSAndroid Build Coastguard Worker        "pypi__pyproject_hooks",
74*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/ae/f3/431b9d5fe7d14af7a32340792ef43b8a714e7726f1d7b69cc4e8e7a3f1d7/pyproject_hooks-1.1.0-py3-none-any.whl",
75*60517a1eSAndroid Build Coastguard Worker        "7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2",
76*60517a1eSAndroid Build Coastguard Worker    ),
77*60517a1eSAndroid Build Coastguard Worker    (
78*60517a1eSAndroid Build Coastguard Worker        "pypi__setuptools",
79*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/de/88/70c5767a0e43eb4451c2200f07d042a4bcd7639276003a9c54a68cfcc1f8/setuptools-70.0.0-py3-none-any.whl",
80*60517a1eSAndroid Build Coastguard Worker        "54faa7f2e8d2d11bcd2c07bed282eef1046b5c080d1c32add737d7b5817b1ad4",
81*60517a1eSAndroid Build Coastguard Worker    ),
82*60517a1eSAndroid Build Coastguard Worker    (
83*60517a1eSAndroid Build Coastguard Worker        "pypi__tomli",
84*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl",
85*60517a1eSAndroid Build Coastguard Worker        "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
86*60517a1eSAndroid Build Coastguard Worker    ),
87*60517a1eSAndroid Build Coastguard Worker    (
88*60517a1eSAndroid Build Coastguard Worker        "pypi__wheel",
89*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl",
90*60517a1eSAndroid Build Coastguard Worker        "55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81",
91*60517a1eSAndroid Build Coastguard Worker    ),
92*60517a1eSAndroid Build Coastguard Worker    (
93*60517a1eSAndroid Build Coastguard Worker        "pypi__zipp",
94*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/da/55/a03fd7240714916507e1fcf7ae355bd9d9ed2e6db492595f1a67f61681be/zipp-3.18.2-py3-none-any.whl",
95*60517a1eSAndroid Build Coastguard Worker        "dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e",
96*60517a1eSAndroid Build Coastguard Worker    ),
97*60517a1eSAndroid Build Coastguard Worker    # END: maintained by 'bazel run //tools/private/update_deps:update_pip_deps'
98*60517a1eSAndroid Build Coastguard Worker]
99*60517a1eSAndroid Build Coastguard Worker
100*60517a1eSAndroid Build Coastguard Worker_GENERIC_WHEEL = """\
101*60517a1eSAndroid Build Coastguard Workerpackage(default_visibility = ["//visibility:public"])
102*60517a1eSAndroid Build Coastguard Worker
103*60517a1eSAndroid Build Coastguard Workerload("@rules_python//python:defs.bzl", "py_library")
104*60517a1eSAndroid Build Coastguard Worker
105*60517a1eSAndroid Build Coastguard Workerpy_library(
106*60517a1eSAndroid Build Coastguard Worker    name = "lib",
107*60517a1eSAndroid Build Coastguard Worker    srcs = glob(["**/*.py"]),
108*60517a1eSAndroid Build Coastguard Worker    data = glob(["**/*"], exclude=[
109*60517a1eSAndroid Build Coastguard Worker        # These entries include those put into user-installed dependencies by
110*60517a1eSAndroid Build Coastguard Worker        # data_exclude to avoid non-determinism.
111*60517a1eSAndroid Build Coastguard Worker        "**/*.py",
112*60517a1eSAndroid Build Coastguard Worker        "**/*.pyc",
113*60517a1eSAndroid Build Coastguard Worker        "**/*.pyc.*",  # During pyc creation, temp files named *.pyc.NNN are created
114*60517a1eSAndroid Build Coastguard Worker        "**/* *",
115*60517a1eSAndroid Build Coastguard Worker        "**/*.dist-info/RECORD",
116*60517a1eSAndroid Build Coastguard Worker        "BUILD",
117*60517a1eSAndroid Build Coastguard Worker        "WORKSPACE",
118*60517a1eSAndroid Build Coastguard Worker    ]),
119*60517a1eSAndroid Build Coastguard Worker    # This makes this directory a top-level in the python import
120*60517a1eSAndroid Build Coastguard Worker    # search path for anything that depends on this.
121*60517a1eSAndroid Build Coastguard Worker    imports = ["."],
122*60517a1eSAndroid Build Coastguard Worker)
123*60517a1eSAndroid Build Coastguard Worker"""
124*60517a1eSAndroid Build Coastguard Worker
125*60517a1eSAndroid Build Coastguard Worker# Collate all the repository names so they can be easily consumed
126*60517a1eSAndroid Build Coastguard Workerall_repo_names = [name for (name, _, _) in _RULE_DEPS]
127*60517a1eSAndroid Build Coastguard Worker
128*60517a1eSAndroid Build Coastguard Workerdef pypi_deps():
129*60517a1eSAndroid Build Coastguard Worker    """
130*60517a1eSAndroid Build Coastguard Worker    Fetch dependencies these rules depend on. Workspaces that use the pip_parse rule can call this.
131*60517a1eSAndroid Build Coastguard Worker    """
132*60517a1eSAndroid Build Coastguard Worker    for (name, url, sha256) in _RULE_DEPS:
133*60517a1eSAndroid Build Coastguard Worker        maybe(
134*60517a1eSAndroid Build Coastguard Worker            http_archive,
135*60517a1eSAndroid Build Coastguard Worker            name,
136*60517a1eSAndroid Build Coastguard Worker            url = url,
137*60517a1eSAndroid Build Coastguard Worker            sha256 = sha256,
138*60517a1eSAndroid Build Coastguard Worker            type = "zip",
139*60517a1eSAndroid Build Coastguard Worker            build_file_content = _GENERIC_WHEEL,
140*60517a1eSAndroid Build Coastguard Worker        )
141