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 rules_python tests and tools.""" 16 17load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") 18load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") 19 20def rules_python_internal_deps(): 21 """Fetches all required dependencies for rules_python tests and tools.""" 22 23 # This version is also used in python/tests/toolchains/workspace_template/WORKSPACE.tmpl 24 # and tests/ignore_root_user_error/WORKSPACE. 25 # If you update this dependency, please update the tests as well. 26 maybe( 27 http_archive, 28 name = "bazel_skylib", 29 sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d", 30 urls = [ 31 "https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", 32 "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", 33 ], 34 ) 35 36 maybe( 37 http_archive, 38 name = "rules_pkg", 39 urls = [ 40 "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", 41 "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", 42 ], 43 sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2", 44 ) 45 46 maybe( 47 http_archive, 48 name = "rules_testing", 49 sha256 = "8df0a8eb21739ea4b0a03f5dc79e68e245a45c076cfab404b940cc205cb62162", 50 strip_prefix = "rules_testing-0.4.0", 51 url = "https://github.com/bazelbuild/rules_testing/releases/download/v0.4.0/rules_testing-v0.4.0.tar.gz", 52 ) 53 54 maybe( 55 http_archive, 56 name = "rules_license", 57 urls = [ 58 "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", 59 "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", 60 ], 61 sha256 = "4531deccb913639c30e5c7512a054d5d875698daeb75d8cf90f284375fe7c360", 62 ) 63 64 maybe( 65 http_archive, 66 name = "io_bazel_stardoc", 67 url = "https://github.com/bazelbuild/stardoc/archive/6f274e903009158504a9d9130d7f7d5f3e9421ed.tar.gz", 68 sha256 = "b5d6891f869d5b5a224316ec4dd9e9d481885a9b1a1c81eb846e20180156f2fa", 69 strip_prefix = "stardoc-6f274e903009158504a9d9130d7f7d5f3e9421ed", 70 ) 71 72 # The below two deps are required for the integration test with bazel 73 # gazelle. Maybe the test should be moved to the `gazelle` workspace? 74 maybe( 75 http_archive, 76 name = "io_bazel_rules_go", 77 sha256 = "6dc2da7ab4cf5d7bfc7c949776b1b7c733f05e56edc4bcd9022bb249d2e2a996", 78 urls = [ 79 "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip", 80 "https://github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip", 81 ], 82 ) 83 84 maybe( 85 http_archive, 86 name = "bazel_gazelle", 87 sha256 = "727f3e4edd96ea20c29e8c2ca9e8d2af724d8c7778e7923a854b2c80952bc405", 88 urls = [ 89 "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz", 90 "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz", 91 ], 92 ) 93 94 # Test data for WHL tool testing. 95 maybe( 96 http_file, 97 name = "futures_2_2_0_whl", 98 downloaded_file_path = "futures-2.2.0-py2.py3-none-any.whl", 99 sha256 = "9fd22b354a4c4755ad8c7d161d93f5026aca4cfe999bd2e53168f14765c02cd6", 100 # From https://pypi.python.org/pypi/futures/2.2.0 101 urls = [ 102 "https://mirror.bazel.build/pypi.python.org/packages/d7/1d/68874943aa37cf1c483fc61def813188473596043158faa6511c04a038b4/futures-2.2.0-py2.py3-none-any.whl", 103 "https://pypi.python.org/packages/d7/1d/68874943aa37cf1c483fc61def813188473596043158faa6511c04a038b4/futures-2.2.0-py2.py3-none-any.whl", 104 ], 105 ) 106 107 maybe( 108 http_file, 109 name = "futures_3_1_1_whl", 110 downloaded_file_path = "futures-3.1.1-py2-none-any.whl", 111 sha256 = "c4884a65654a7c45435063e14ae85280eb1f111d94e542396717ba9828c4337f", 112 # From https://pypi.python.org/pypi/futures 113 urls = [ 114 "https://mirror.bazel.build/pypi.python.org/packages/a6/1c/72a18c8c7502ee1b38a604a5c5243aa8c2a64f4bba4e6631b1b8972235dd/futures-3.1.1-py2-none-any.whl", 115 "https://pypi.python.org/packages/a6/1c/72a18c8c7502ee1b38a604a5c5243aa8c2a64f4bba4e6631b1b8972235dd/futures-3.1.1-py2-none-any.whl", 116 ], 117 ) 118 119 maybe( 120 http_file, 121 name = "google_cloud_language_whl", 122 downloaded_file_path = "google_cloud_language-0.29.0-py2.py3-none-any.whl", 123 sha256 = "a2dd34f0a0ebf5705dcbe34bd41199b1d0a55c4597d38ed045bd183361a561e9", 124 # From https://pypi.python.org/pypi/google-cloud-language 125 urls = [ 126 "https://mirror.bazel.build/pypi.python.org/packages/6e/86/cae57e4802e72d9e626ee5828ed5a646cf4016b473a4a022f1038dba3460/google_cloud_language-0.29.0-py2.py3-none-any.whl", 127 "https://pypi.python.org/packages/6e/86/cae57e4802e72d9e626ee5828ed5a646cf4016b473a4a022f1038dba3460/google_cloud_language-0.29.0-py2.py3-none-any.whl", 128 ], 129 ) 130 131 maybe( 132 http_file, 133 name = "grpc_whl", 134 downloaded_file_path = "grpcio-1.6.0-cp27-cp27m-manylinux1_i686.whl", 135 sha256 = "c232d6d168cb582e5eba8e1c0da8d64b54b041dd5ea194895a2fe76050916561", 136 # From https://pypi.python.org/pypi/grpcio/1.6.0 137 urls = [ 138 "https://mirror.bazel.build/pypi.python.org/packages/c6/28/67651b4eabe616b27472c5518f9b2aa3f63beab8f62100b26f05ac428639/grpcio-1.6.0-cp27-cp27m-manylinux1_i686.whl", 139 "https://pypi.python.org/packages/c6/28/67651b4eabe616b27472c5518f9b2aa3f63beab8f62100b26f05ac428639/grpcio-1.6.0-cp27-cp27m-manylinux1_i686.whl", 140 ], 141 ) 142 143 maybe( 144 http_file, 145 name = "mock_whl", 146 downloaded_file_path = "mock-2.0.0-py2.py3-none-any.whl", 147 sha256 = "5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1", 148 # From https://pypi.python.org/pypi/mock 149 urls = [ 150 "https://mirror.bazel.build/pypi.python.org/packages/e6/35/f187bdf23be87092bd0f1200d43d23076cee4d0dec109f195173fd3ebc79/mock-2.0.0-py2.py3-none-any.whl", 151 "https://pypi.python.org/packages/e6/35/f187bdf23be87092bd0f1200d43d23076cee4d0dec109f195173fd3ebc79/mock-2.0.0-py2.py3-none-any.whl", 152 ], 153 ) 154 155 maybe( 156 http_archive, 157 name = "build_bazel_integration_testing", 158 urls = [ 159 "https://github.com/bazelbuild/bazel-integration-testing/archive/165440b2dbda885f8d1ccb8d0f417e6cf8c54f17.zip", 160 ], 161 strip_prefix = "bazel-integration-testing-165440b2dbda885f8d1ccb8d0f417e6cf8c54f17", 162 sha256 = "2401b1369ef44cc42f91dc94443ef491208dbd06da1e1e10b702d8c189f098e3", 163 ) 164 165 maybe( 166 http_archive, 167 name = "rules_proto", 168 sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", 169 strip_prefix = "rules_proto-5.3.0-21.7", 170 urls = [ 171 "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", 172 ], 173 ) 174 175 maybe( 176 http_archive, 177 name = "com_google_protobuf", 178 sha256 = "75be42bd736f4df6d702a0e4e4d30de9ee40eac024c4b845d17ae4cc831fe4ae", 179 strip_prefix = "protobuf-21.7", 180 urls = [ 181 "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz", 182 "https://github.com/protocolbuffers/protobuf/archive/v21.7.tar.gz", 183 ], 184 ) 185