• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2023 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"""Dependencies that are needed for development and testing of rules_python itself."""
16
17load("@bazel_tools//tools/build_defs/repo:http.bzl", _http_archive = "http_archive", _http_file = "http_file")
18load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
19
20def http_archive(name, **kwargs):
21    maybe(
22        _http_archive,
23        name = name,
24        **kwargs
25    )
26
27def http_file(name, **kwargs):
28    maybe(
29        _http_file,
30        name = name,
31        **kwargs
32    )
33
34def rules_python_internal_deps():
35    """Fetches all required dependencies for developing/testing rules_python itself.
36
37    Setup of these dependencies is done by `internal_dev_setup.bzl`
38
39    For dependencies needed by *users* of rules_python, see
40    python/private/py_repositories.bzl.
41    """
42
43    http_archive(
44        name = "bazel_skylib",
45        sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
46        urls = [
47            "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
48            "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
49        ],
50    )
51
52    # See https://github.com/bazelbuild/rules_shell/releases/tag/v0.2.0
53    http_archive(
54        name = "rules_shell",
55        sha256 = "410e8ff32e018b9efd2743507e7595c26e2628567c42224411ff533b57d27c28",
56        strip_prefix = "rules_shell-0.2.0",
57        url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.2.0/rules_shell-v0.2.0.tar.gz",
58    )
59
60    http_archive(
61        name = "rules_pkg",
62        urls = [
63            "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
64            "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
65        ],
66        sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2",
67    )
68
69    http_archive(
70        name = "rules_testing",
71        sha256 = "02c62574631876a4e3b02a1820cb51167bb9cdcdea2381b2fa9d9b8b11c407c4",
72        strip_prefix = "rules_testing-0.6.0",
73        url = "https://github.com/bazelbuild/rules_testing/releases/download/v0.6.0/rules_testing-v0.6.0.tar.gz",
74    )
75
76    http_archive(
77        name = "io_bazel_stardoc",
78        sha256 = "62bd2e60216b7a6fec3ac79341aa201e0956477e7c8f6ccc286f279ad1d96432",
79        urls = [
80            "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz",
81            "https://github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz",
82        ],
83    )
84
85    # The below two deps are required for the integration test with bazel
86    # gazelle. Maybe the test should be moved to the `gazelle` workspace?
87    http_archive(
88        name = "io_bazel_rules_go",
89        sha256 = "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3",
90        urls = [
91            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
92            "https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
93        ],
94    )
95
96    http_archive(
97        name = "bazel_gazelle",
98        sha256 = "727f3e4edd96ea20c29e8c2ca9e8d2af724d8c7778e7923a854b2c80952bc405",
99        urls = [
100            "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz",
101            "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz",
102        ],
103    )
104
105    # Test data for WHL tool testing.
106    http_file(
107        name = "futures_2_2_0_whl",
108        downloaded_file_path = "futures-2.2.0-py2.py3-none-any.whl",
109        sha256 = "9fd22b354a4c4755ad8c7d161d93f5026aca4cfe999bd2e53168f14765c02cd6",
110        # From https://pypi.org/pypi/futures/2.2.0
111        urls = [
112            "https://mirror.bazel.build/pypi.org/packages/d7/1d/68874943aa37cf1c483fc61def813188473596043158faa6511c04a038b4/futures-2.2.0-py2.py3-none-any.whl",
113            "https://pypi.org/packages/d7/1d/68874943aa37cf1c483fc61def813188473596043158faa6511c04a038b4/futures-2.2.0-py2.py3-none-any.whl",
114        ],
115    )
116
117    http_file(
118        name = "futures_3_1_1_whl",
119        downloaded_file_path = "futures-3.1.1-py2-none-any.whl",
120        sha256 = "c4884a65654a7c45435063e14ae85280eb1f111d94e542396717ba9828c4337f",
121        # From https://pypi.org/pypi/futures
122        urls = [
123            "https://mirror.bazel.build/pypi.org/packages/a6/1c/72a18c8c7502ee1b38a604a5c5243aa8c2a64f4bba4e6631b1b8972235dd/futures-3.1.1-py2-none-any.whl",
124            "https://pypi.org/packages/a6/1c/72a18c8c7502ee1b38a604a5c5243aa8c2a64f4bba4e6631b1b8972235dd/futures-3.1.1-py2-none-any.whl",
125        ],
126    )
127
128    http_file(
129        name = "google_cloud_language_whl",
130        downloaded_file_path = "google_cloud_language-0.29.0-py2.py3-none-any.whl",
131        sha256 = "a2dd34f0a0ebf5705dcbe34bd41199b1d0a55c4597d38ed045bd183361a561e9",
132        # From https://pypi.org/pypi/google-cloud-language
133        urls = [
134            "https://mirror.bazel.build/pypi.org/packages/6e/86/cae57e4802e72d9e626ee5828ed5a646cf4016b473a4a022f1038dba3460/google_cloud_language-0.29.0-py2.py3-none-any.whl",
135            "https://pypi.org/packages/6e/86/cae57e4802e72d9e626ee5828ed5a646cf4016b473a4a022f1038dba3460/google_cloud_language-0.29.0-py2.py3-none-any.whl",
136        ],
137    )
138
139    http_file(
140        name = "grpc_whl",
141        downloaded_file_path = "grpcio-1.6.0-cp27-cp27m-manylinux1_i686.whl",
142        sha256 = "c232d6d168cb582e5eba8e1c0da8d64b54b041dd5ea194895a2fe76050916561",
143        # From https://pypi.org/pypi/grpcio/1.6.0
144        urls = [
145            "https://mirror.bazel.build/pypi.org/packages/c6/28/67651b4eabe616b27472c5518f9b2aa3f63beab8f62100b26f05ac428639/grpcio-1.6.0-cp27-cp27m-manylinux1_i686.whl",
146            "https://pypi.org/packages/c6/28/67651b4eabe616b27472c5518f9b2aa3f63beab8f62100b26f05ac428639/grpcio-1.6.0-cp27-cp27m-manylinux1_i686.whl",
147        ],
148    )
149
150    http_file(
151        name = "mock_whl",
152        downloaded_file_path = "mock-2.0.0-py2.py3-none-any.whl",
153        sha256 = "5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1",
154        # From https://pypi.org/pypi/mock
155        urls = [
156            "https://mirror.bazel.build/pypi.org/packages/e6/35/f187bdf23be87092bd0f1200d43d23076cee4d0dec109f195173fd3ebc79/mock-2.0.0-py2.py3-none-any.whl",
157            "https://pypi.org/packages/e6/35/f187bdf23be87092bd0f1200d43d23076cee4d0dec109f195173fd3ebc79/mock-2.0.0-py2.py3-none-any.whl",
158        ],
159    )
160
161    http_archive(
162        name = "rules_bazel_integration_test",
163        sha256 = "6e65d497c68f5794349bfa004369e144063686ce1ebd0227717cd23285be45ef",
164        urls = [
165            "https://github.com/bazel-contrib/rules_bazel_integration_test/releases/download/v0.20.0/rules_bazel_integration_test.v0.20.0.tar.gz",
166        ],
167    )
168
169    # Dependency of rules_bazel_integration_test.
170    http_archive(
171        name = "cgrindel_bazel_starlib",
172        sha256 = "9090280a9cff7322e7c22062506b3273a2e880ca464e520b5c77fdfbed4e8805",
173        urls = [
174            "https://github.com/cgrindel/bazel-starlib/releases/download/v0.18.1/bazel-starlib.v0.18.1.tar.gz",
175        ],
176    )
177
178    http_archive(
179        name = "rules_proto",
180        sha256 = "904a8097fae42a690c8e08d805210e40cccb069f5f9a0f6727cf4faa7bed2c9c",
181        strip_prefix = "rules_proto-6.0.0-rc1",
182        url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.0-rc1/rules_proto-6.0.0-rc1.tar.gz",
183    )
184
185    http_archive(
186        name = "com_google_protobuf",
187        sha256 = "23082dca1ca73a1e9c6cbe40097b41e81f71f3b4d6201e36c134acc30a1b3660",
188        url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.0-rc2/protobuf-29.0-rc2.zip",
189        strip_prefix = "protobuf-29.0-rc2",
190    )
191
192    # Needed for stardoc
193    http_archive(
194        name = "rules_java",
195        urls = [
196            "https://mirror.bazel.build/github.com/bazelbuild/rules_java/releases/download/8.3.1/rules_java-8.3.1.tar.gz",
197            "https://github.com/bazelbuild/rules_java/releases/download/8.3.1/rules_java-8.3.1.tar.gz",
198        ],
199        sha256 = "ee786b943e00da4fea7c233e70e5f5b8a01cc69b9341b3f49169f174fe0df1c5",
200    )
201
202    RULES_JVM_EXTERNAL_TAG = "5.2"
203    RULES_JVM_EXTERNAL_SHA = "f86fd42a809e1871ca0aabe89db0d440451219c3ce46c58da240c7dcdc00125f"
204    http_archive(
205        name = "rules_jvm_external",
206        patch_args = ["-p1"],
207        patches = ["@io_bazel_stardoc//:rules_jvm_external.patch"],
208        strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
209        sha256 = RULES_JVM_EXTERNAL_SHA,
210        url = "https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG),
211    )
212
213    http_archive(
214        name = "rules_license",
215        urls = [
216            "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz",
217            "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz",
218        ],
219        sha256 = "4531deccb913639c30e5c7512a054d5d875698daeb75d8cf90f284375fe7c360",
220    )
221
222    http_archive(
223        name = "bazel_features",
224        sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
225        strip_prefix = "bazel_features-1.9.1",
226        url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
227    )
228
229    http_archive(
230        name = "rules_cc",
231        urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.16/rules_cc-0.0.16.tar.gz"],
232        sha256 = "bbf1ae2f83305b7053b11e4467d317a7ba3517a12cef608543c1b1c5bf48a4df",
233        strip_prefix = "rules_cc-0.0.16",
234    )
235
236    http_archive(
237        name = "rules_multirun",
238        sha256 = "0e124567fa85287874eff33a791c3bbdcc5343329a56faa828ef624380d4607c",
239        url = "https://github.com/keith/rules_multirun/releases/download/0.9.0/rules_multirun.0.9.0.tar.gz",
240    )
241